Commit 053ecae5 authored by Carl Worth's avatar Carl Worth Committed by Carlos Garcia Campos

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.
parent bf6dd890
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment