summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-03-17 05:00:29 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-03-17 05:00:29 +0000
commitfa31c398d5ba1eba4190b32b3c61b8635c7407c3 (patch)
treeb44bf6c7c08ce715e48578ef8da2c69fde95b2dc /src/sp-item.cpp
parentFix bug #1511262: don't snap rect to itself (diff)
downloadinkscape-fa31c398d5ba1eba4190b32b3c61b8635c7407c3.tar.gz
inkscape-fa31c398d5ba1eba4190b32b3c61b8635c7407c3.zip
fix 1286535
(bzr r2676)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 90781d37b..27f6e4ce3 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -1098,22 +1098,27 @@ sp_item_adjust_paint_recursive (SPItem *item, NR::Matrix advertized_transform, N
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();
- if (is_pattern)
- sp_item_adjust_pattern (item, paint_delta);
- else
- sp_item_adjust_gradient (item, paint_delta);
-
// Within text, we do not fork gradients, and so must not recurse to avoid double compensation
- if (item && SP_IS_TEXT(item))
- return;
-
- for (SPObject *o = SP_OBJECT(item)->children; o != NULL; o = o->next) {
- if (SP_IS_ITEM(o)) {
+ if (!(item && SP_IS_TEXT(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;
// below it, it is the accmmulated chain of transforms from this level to the top level
- sp_item_adjust_paint_recursive (SP_ITEM(o), advertized_transform, t_item * t_ancestors, is_pattern);
+ sp_item_adjust_paint_recursive (SP_ITEM(o), advertized_transform, t_item * t_ancestors, is_pattern);
+ }
}
}
+
+// We recursed into children first, and are now adjusting this object second;
+// this is so that adjustments in a tree are done from leaves up to the root,
+// and paintservers on leaves inheriting their values from ancestors could adjust themselves properly
+// before ancestors themselves are adjusted, probably differently (bug 1286535)
+
+ if (is_pattern)
+ sp_item_adjust_pattern (item, paint_delta);
+ else
+ sp_item_adjust_gradient (item, paint_delta);
+
}
/**