diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-10-08 06:51:45 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-10-08 06:51:45 +0000 |
| commit | d9273f1a3d804ef5fbe782473502e6b9314ec437 (patch) | |
| tree | 1fa4cbd00ab6d84b8f4a3c6b5363ea4531357084 /src/sp-use.cpp | |
| parent | fix for filter (non)inheritance and a crude workaround for filter merging (diff) | |
| download | inkscape-d9273f1a3d804ef5fbe782473502e6b9314ec437.tar.gz inkscape-d9273f1a3d804ef5fbe782473502e6b9314ec437.zip | |
Internally, a clone is a NRArenaGroup, with the actual visible item being its child. Previously, that child inherited the style from the parent group, but the group itsef was not styled. However this does not work for filter (at least) because it is by default a noninherited property. So, for all properties to work on clones, we need to set the style on the NRArenaGroup explicitly, just as SPItemGroup does the same.
(bzr r1780)
Diffstat (limited to 'src/sp-use.cpp')
| -rw-r--r-- | src/sp-use.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 31bee3717..ae4e9f61a 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -333,6 +333,7 @@ sp_use_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags) NRArenaItem *ai = NRArenaGroup::create(arena); nr_arena_group_set_transparent(NR_ARENA_GROUP(ai), FALSE); + nr_arena_group_set_style(NR_ARENA_GROUP(ai), SP_OBJECT_STYLE(item)); if (use->child) { NRArenaItem *ac = sp_item_invoke_show(SP_ITEM(use->child), arena, key, flags); @@ -566,6 +567,12 @@ sp_use_update(SPObject *object, SPCtx *ctx, unsigned flags) if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; + if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { + for (SPItemView *v = SP_ITEM(object)->display; v != NULL; v = v->next) { + nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); + } + } + /* Set up child viewport */ if (use->x.unit == SVGLength::PERCENT) { use->x.computed = use->x.value * (ictx->vp.x1 - ictx->vp.x0); @@ -619,6 +626,12 @@ sp_use_modified(SPObject *object, guint flags) } flags &= SP_OBJECT_MODIFIED_CASCADE; + if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { + for (SPItemView *v = SP_ITEM(object)->display; v != NULL; v = v->next) { + nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); + } + } + SPObject *child = use_obj->child; if (child) { g_object_ref(G_OBJECT(child)); |
