summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 673b4f7)
raw | patch | inline | side by side (parent: 673b4f7)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 31 Aug 2008 20:04:13 +0000 (20:04 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 31 Aug 2008 20:04:13 +0000 (20:04 +0000) |
src/extension/internal/cairo-render-context.h | patch | blob | history | |
src/extension/internal/cairo-renderer.cpp | patch | blob | history |
diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h
index e9241808589f59ce02ccea967b4af3990be792f6..d3d4ddd56000e0af8167f61590e42c5fb409c3df 100644 (file)
unsigned int parent_has_userspace : 1; // whether the parent's ctm should be applied
float opacity;
bool has_filtereffect;
+ Geom::Matrix item_transform; // this item's item->transform, for correct clipping
SPClipPath *clip_path;
SPMask* mask;
index 8d4b95f855b2dcb81422f23ec5a5d0a84f16435b..be9953ae196ab9b0fde83a3b9bb78d09bac58b71 100644 (file)
CairoRenderState *state = ctx->getCurrentState();
state->clip_path = item->clip_ref->getObject();
state->mask = item->mask_ref->getObject();
+ state->item_transform = Geom::Matrix (item->transform);
// If parent_has_userspace is true the parent state's transform
// has to be used for the mask's/clippath's context.
for (SPObject *child = sp_object_first_child(co) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
SPItem *item = SP_ITEM(child);
- renderItem(ctx, item);
+
+ // combine transform of the item in clippath and the item using clippath:
+ Geom::Matrix tempmat (item->transform);
+ tempmat = tempmat * (ctx->getCurrentState()->item_transform);
+
+ // render this item in clippath
+ ctx->pushState();
+ ctx->transform(&tempmat);
+ setStateForItem(ctx, item);
+ sp_item_invoke_render(item, ctx);
+ ctx->popState();
}
}
TRACE(("END clip\n"));