diff options
Diffstat (limited to 'src/sp-item-group.cpp')
| -rw-r--r-- | src/sp-item-group.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 992bca631..acf8b2012 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -40,7 +40,7 @@ #include "box3d.h" #include "persp3d.h" #include "inkscape.h" -#include "desktop-handles.h" + #include "selection.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" @@ -159,6 +159,7 @@ void SPGroup::order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *ol } void SPGroup::update(SPCtx *ctx, unsigned int flags) { + // std::cout << "SPGroup::update(): " << (getId()?getId():"null") << std::endl; SPItemCtx *ictx, cctx; ictx = (SPItemCtx *) ctx; @@ -199,12 +200,16 @@ void SPGroup::update(SPCtx *ctx, unsigned int flags) { if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { for (SPItemView *v = this->display; v != NULL; v = v->next) { Inkscape::DrawingGroup *group = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem); - group->setStyle(this->style); + if( this->parent ) { + this->context_style = this->parent->context_style; + } + group->setStyle(this->style, this->context_style); } } } void SPGroup::modified(guint flags) { + // std::cout << "SPGroup::modified(): " << (getId()?getId():"null") << std::endl; SPLPEItem::modified(flags); SPObject *child; @@ -352,11 +357,15 @@ void SPGroup::set(unsigned int key, gchar const* value) { } Inkscape::DrawingItem *SPGroup::show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) { + // std::cout << "SPGroup::show(): " << (getId()?getId():"null") << std::endl; Inkscape::DrawingGroup *ai; ai = new Inkscape::DrawingGroup(drawing); ai->setPickChildren(this->effectiveLayerMode(key) == SPGroup::LAYER); - ai->setStyle(this->style); + if( this->parent ) { + this->context_style = this->parent->context_style; + } + ai->setStyle(this->style, this->context_style); this->_showChildren(drawing, ai, key, flags); return ai; @@ -435,7 +444,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) // it here _before_ the new transform is set, so as to use the pre-transform bbox citem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false); - sp_style_merge_from_dying_parent(child->style, group->style); + child->style->merge( group->style ); /* * fixme: We currently make no allowance for the case where child is cloned * and the group has any style settings. @@ -444,9 +453,8 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) * version of inkscape without using the XML editor: we usually apply group * style changes to children rather than to the group itself.) * - * If the group has no style settings, then - * sp_style_merge_from_dying_parent should be a no-op. Otherwise (i.e. if - * we change the child's style to compensate for its parent going away) + * If the group has no style settings, then style->merge() should be a no-op. Otherwise + * (i.e. if we change the child's style to compensate for its parent going away) * then those changes will typically be reflected in any clones of child, * whereas we'd prefer for Ungroup not to affect the visual appearance. * |
