From 2eb1aa697cdab1dd801f7cf3d3816b2ead21f192 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 20 Feb 2008 17:21:27 -0800 Subject: [PATCH] Keep cairo and cairo_shape consistent The 'cairo_shape' state was not always being modified at the same time as 'cairo'. In some cases this led to a sequence of ever larger matrix scale factors until things just blew up. --- poppler/CairoOutputDev.cc | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 0bc0ab4..43b1ca4 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -158,11 +158,15 @@ void CairoOutputDev::drawLink(Link *link, Catalog *catalog) { void CairoOutputDev::saveState(GfxState *state) { LOG(printf ("save\n")); cairo_save (cairo); + if (cairo_shape) + cairo_save (cairo_shape); } void CairoOutputDev::restoreState(GfxState *state) { LOG(printf ("restore\n")); cairo_restore (cairo); + if (cairo_shape) + cairo_restore (cairo_shape); /* These aren't restored by cairo_restore() since we keep them in * the output device. */ @@ -196,6 +200,8 @@ void CairoOutputDev::setDefaultCTM(double *ctm) { matrix.y0 = ctm[5]; cairo_transform (cairo, &matrix); + if (shape) + cairo_transform (cairo_shape, &matrix); OutputDev::setDefaultCTM(ctm); } -- 1.5.4.1