Code

Fix clipping for Cairo generated PNG's.
authortavmjong <tavmjong@users.sourceforge.net>
Wed, 10 Sep 2008 13:26:52 +0000 (13:26 +0000)
committertavmjong <tavmjong@users.sourceforge.net>
Wed, 10 Sep 2008 13:26:52 +0000 (13:26 +0000)
src/extension/internal/cairo-render-context.cpp

index e2e154791a4462ecb7e4cb70c00bd84b87765d4e..f2ee32c74c8274fcfe10c627aa2d10ab120846bd 100644 (file)
@@ -590,13 +590,16 @@ CairoRenderContext::popLayer(void)
                     cairo_set_source_rgba(clip_ctx->_cr, 1.0, 1.0, 1.0, 1.0);
 
                 // copy over the correct CTM
+                // It must be stored in item_transform of current state after pushState.
+                Geom::Matrix item_transform; 
                 if (_state->parent_has_userspace)
-                    clip_ctx->setTransform(&getParentState()->transform);
+                    item_transform = getParentState()->transform;
                 else
-                    clip_ctx->setTransform(&_state->transform);
+                    item_transform = _state->transform;
 
                 // apply the clip path
                 clip_ctx->pushState();
+                clip_ctx->getCurrentState()->item_transform = item_transform;
                 _renderer->applyClipPath(clip_ctx, clip_path);
                 clip_ctx->popState();