diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2013-10-01 00:04:26 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2013-10-01 00:04:26 +0000 |
| commit | 3f306a1dcb2eac6533ac70ba8dd27087a8c62dc0 (patch) | |
| tree | 9f7ab404284537f066d806c4162d41a9fcf994fb /src/sp-item-group.cpp | |
| parent | more string leaks (diff) | |
| download | inkscape-3f306a1dcb2eac6533ac70ba8dd27087a8c62dc0.tar.gz inkscape-3f306a1dcb2eac6533ac70ba8dd27087a8c62dc0.zip | |
Fix computed shapes disappearing when grouping within filtered groups.
Fixes blocker LP bug #850992.
Fixed bugs:
- https://launchpad.net/bugs/850992
(bzr r12643)
Diffstat (limited to 'src/sp-item-group.cpp')
| -rw-r--r-- | src/sp-item-group.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index a99a3e988..284d3317a 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -161,44 +161,49 @@ void SPGroup::order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *ol } void SPGroup::update(SPCtx *ctx, unsigned int flags) { - SPLPEItem::update(ctx, flags); - SPItemCtx *ictx, cctx; ictx = (SPItemCtx *) ctx; cctx = *ictx; - if (flags & SP_OBJECT_MODIFIED_FLAG) { - flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; - } - - flags &= SP_OBJECT_MODIFIED_CASCADE; + unsigned childflags = 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 (flags & SP_OBJECT_MODIFIED_FLAG) { + childflags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } + childflags &= SP_OBJECT_MODIFIED_CASCADE; GSList *l = g_slist_reverse(this->childList(true, SPObject::ActionUpdate)); while (l) { SPObject *child = SP_OBJECT (l->data); l = g_slist_remove (l, child); - if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { + if (childflags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { if (SP_IS_ITEM (child)) { SPItem const &chi = *SP_ITEM(child); cctx.i2doc = chi.transform * ictx->i2doc; cctx.i2vp = chi.transform * ictx->i2vp; - child->updateDisplay((SPCtx *)&cctx, flags); + child->updateDisplay((SPCtx *)&cctx, childflags); } else { - child->updateDisplay(ctx, flags); + child->updateDisplay(ctx, childflags); } } sp_object_unref(child); } + + // For a group, we need to update ourselves *after* updating children. + // this is because the group might contain shapes such as rect or ellipse, + // which recompute their equivalent path (a.k.a curve) in the update callback, + // and this is in turn used when computing bbox. + SPLPEItem::update(ctx, 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); + } + } } void SPGroup::modified(guint flags) { |
