From c506ddb58612c69b80b08be3a6d14c5bcc1ac21f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 27 Jun 2009 16:54:37 +0100 Subject: [PATCH] [pdf] Restore original surface size after emitting group mask A trivial fix to reset the original surface size after emitting the group. The annoying aspect is that this should have been caught by the test suite. Alas, no. A gentle reminder that simple line coverage is insufficient. :( --- src/cairo-pdf-surface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 961325bb9..88b17440e 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -4694,8 +4694,10 @@ _cairo_pdf_surface_write_smask_group (cairo_pdf_surface_t *surface, group->height); /* _mask is a special case that requires two groups - source * and mask as well as a smask and gstate dictionary */ - if (group->operation == PDF_MASK) - return _cairo_pdf_surface_write_mask_group (surface, group); + if (group->operation == PDF_MASK) { + status = _cairo_pdf_surface_write_mask_group (surface, group); + goto RESTORE_SIZE; + } status = _cairo_pdf_surface_open_group (surface, &group->group_res); if (unlikely (status)) @@ -4747,6 +4749,7 @@ _cairo_pdf_surface_write_smask_group (cairo_pdf_surface_t *surface, status = _cairo_pdf_surface_close_group (surface, NULL); +RESTORE_SIZE: _cairo_pdf_surface_set_size_internal (surface, old_width, old_height);