summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-04-24 07:02:09 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-04-24 07:02:09 +0000
commit52f26e450e7b33bff70ae7fc3b243ab13d9b6407 (patch)
treefb0c92a70bf8c20dfe84e51e99d1f95a75e2d921 /src/sp-item.cpp
parentfix 1705412: handle gracefully assigning gradients to no-bbox items (diff)
downloadinkscape-52f26e450e7b33bff70ae7fc3b243ab13d9b6407.tar.gz
inkscape-52f26e450e7b33bff70ae7fc3b243ab13d9b6407.zip
skip recursion into clone's children in stroke adjustment; fix paint adjuster so it does not recurse into a clone's children but adjusts the clone itself
(bzr r2954)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 5858f5d4e..9e836e84a 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -1060,6 +1060,10 @@ sp_item_adjust_stroke_width_recursive(SPItem *item, double expansion)
{
sp_item_adjust_stroke (item, expansion);
+// A clone's child is the ghost of its original - we must not touch it, skip recursion
+ if (item && SP_IS_USE(item))
+ return;
+
for (SPObject *o = SP_OBJECT(item)->children; o != NULL; o = o->next) {
if (SP_IS_ITEM(o))
sp_item_adjust_stroke_width_recursive(SP_ITEM(o), expansion);
@@ -1088,18 +1092,16 @@ sp_item_adjust_rects_recursive(SPItem *item, NR::Matrix advertized_transform)
void
sp_item_adjust_paint_recursive (SPItem *item, NR::Matrix advertized_transform, NR::Matrix t_ancestors, bool is_pattern)
{
-// A clone must not touch the style (it's that of its parent!) and has no children, so quit now
- if (item && SP_IS_USE(item))
- return;
-
// _Before_ full pattern/gradient transform: t_paint * t_item * t_ancestors
// _After_ full pattern/gradient transform: t_paint_new * t_item * t_ancestors * advertised_transform
// By equating these two expressions we get t_paint_new = t_paint * paint_delta, where:
NR::Matrix t_item = sp_item_transform_repr (item);
NR::Matrix paint_delta = t_item * t_ancestors * advertized_transform * t_ancestors.inverse() * t_item.inverse();
-// Within text, we do not fork gradients, and so must not recurse to avoid double compensation
- if (!(item && SP_IS_TEXT(item))) {
+// Within text, we do not fork gradients, and so must not recurse to avoid double compensation;
+// also we do not recurse into clones, because a clone's child is the ghost of its original -
+// we must not touch it
+ if (!(item && (SP_IS_TEXT(item) || SP_IS_USE(item)))) {
for (SPObject *o = SP_OBJECT(item)->children; o != NULL; o = o->next) {
if (SP_IS_ITEM(o)) {
// At the level of the transformed item, t_ancestors is identity;