projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cairo: Apply margins to pages added with xr_driver_next_page().
[pspp-builds.git]
/
src
/
output
/
cairo.c
diff --git
a/src/output/cairo.c
b/src/output/cairo.c
index 897d25afebf8eee4d3fda1993366279caabe7585..674d91488877d642320dbc36626736a98233227e 100644
(file)
--- a/
src/output/cairo.c
+++ b/
src/output/cairo.c
@@
-205,7
+205,7
@@
xr_allocate (const char *name, int device_type, struct string_map *o)
xr->line_gutter = XR_POINT;
xr->line_space = XR_POINT;
xr->line_width = XR_POINT / 2;
xr->line_gutter = XR_POINT;
xr->line_space = XR_POINT;
xr->line_width = XR_POINT / 2;
- xr->page_number =
1
;
+ xr->page_number =
0
;
return xr;
}
return xr;
}
@@
-302,13
+302,12
@@
xr_create (const char *file_name, enum settings_output_devices device_type,
xr->cairo = cairo_create (surface);
cairo_surface_destroy (surface);
xr->cairo = cairo_create (surface);
cairo_surface_destroy (surface);
- cairo_translate (xr->cairo,
- xr_to_pt (xr->left_margin),
- xr_to_pt (xr->top_margin));
-
if (!xr_set_cairo (xr, xr->cairo))
goto error;
if (!xr_set_cairo (xr, xr->cairo))
goto error;
+ cairo_save (xr->cairo);
+ xr_driver_next_page (xr, xr->cairo);
+
if (xr->width / (xr->font_height / 2) < MIN_WIDTH)
{
error (0, 0, _("The defined page is not wide enough to hold at least %d "
if (xr->width / (xr->font_height / 2) < MIN_WIDTH)
{
error (0, 0, _("The defined page is not wide enough to hold at least %d "
@@
-431,7
+430,9
@@
xr_submit (struct output_driver *driver, const struct output_item *output_item)
xr_driver_output_item (xr, output_item);
while (xr_driver_need_new_page (xr))
{
xr_driver_output_item (xr, output_item);
while (xr_driver_need_new_page (xr))
{
+ cairo_restore (xr->cairo);
cairo_show_page (xr->cairo);
cairo_show_page (xr->cairo);
+ cairo_save (xr->cairo);
xr_driver_next_page (xr, xr->cairo);
}
}
xr_driver_next_page (xr, xr->cairo);
}
}
@@
-450,6
+451,11
@@
xr_submit (struct output_driver *driver, const struct output_item *output_item)
void
xr_driver_next_page (struct xr_driver *xr, cairo_t *cairo)
{
void
xr_driver_next_page (struct xr_driver *xr, cairo_t *cairo)
{
+ if (cairo != NULL)
+ cairo_translate (cairo,
+ xr_to_pt (xr->left_margin),
+ xr_to_pt (xr->top_margin));
+
xr->page_number++;
xr->cairo = cairo;
xr->y = 0;
xr->page_number++;
xr->cairo = cairo;
xr->y = 0;