From 86568a2d2943469ff6ec3a00d2fa2b300b5f35ae Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 8 Oct 2006 06:51:45 +0000 Subject: [PATCH] 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. --- src/sp-use.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)); -- 2.30.2