diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2013-10-01 13:25:44 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2013-10-01 13:25:44 +0000 |
| commit | 87d93e27330577c2fd632dbaccbd3103884aa590 (patch) | |
| tree | 2acaa8e8ab51a4dbaef40bd22bd780bdaceae0db /src/sp-use.cpp | |
| parent | Fix possible bug in DrawingItem code (diff) | |
| download | inkscape-87d93e27330577c2fd632dbaccbd3103884aa590.tar.gz inkscape-87d93e27330577c2fd632dbaccbd3103884aa590.zip | |
Comprehensive fix for the issues with disappearing filtered objects.
Fixes #304407 and possibly a few other bugs.
Revert incorrect _item_bbox changes from r12528.
Fixed bugs:
- https://launchpad.net/bugs/304407
(bzr r12648)
Diffstat (limited to 'src/sp-use.cpp')
| -rw-r--r-- | src/sp-use.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/sp-use.cpp b/src/sp-use.cpp index a558c6bf4..ec367d786 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -476,20 +476,12 @@ void SPUse::update(SPCtx *ctx, unsigned flags) { SPItemCtx *ictx = (SPItemCtx *) ctx; SPItemCtx cctx = *ictx; - SPItem::update(ctx, flags); - + unsigned childflags = flags; if (flags & SP_OBJECT_MODIFIED_FLAG) { - flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; + childflags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } - flags &= SP_OBJECT_MODIFIED_CASCADE; - - if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { - for (SPItemView *v = this->display; v != NULL; v = v->next) { - Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem); - g->setStyle(this->style); - } - } + childflags &= SP_OBJECT_MODIFIED_CASCADE; /* Set up child viewport */ if (this->x.unit == SVGLength::PERCENT) { @@ -510,21 +502,30 @@ void SPUse::update(SPCtx *ctx, unsigned flags) { cctx.viewport = Geom::Rect::from_xywh(0, 0, this->width.computed, this->height.computed); cctx.i2vp = Geom::identity(); - flags&=~SP_OBJECT_USER_MODIFIED_FLAG_B; + childflags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; if (this->child) { sp_object_ref(this->child); - if (flags || (this->child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { + if (childflags || (this->child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { SPItem const &chi = *SP_ITEM(this->child); cctx.i2doc = chi.transform * ictx->i2doc; cctx.i2vp = chi.transform * ictx->i2vp; - this->child->updateDisplay((SPCtx *)&cctx, flags); + this->child->updateDisplay((SPCtx *)&cctx, childflags); } sp_object_unref(this->child); } + SPItem::update(ctx, flags); + + if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { + for (SPItemView *v = this->display; v != NULL; v = v->next) { + Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem); + g->setStyle(this->style); + } + } + /* As last step set additional transform of arena group */ for (SPItemView *v = this->display; v != NULL; v = v->next) { Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem); |
