From e4df289bd436daf43602c3bac2a7628f45b789c8 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Sun, 18 May 2008 21:02:43 +0000 Subject: Add a function doOnApply() for LPEs which is executed once when the effect is applied to an item (contrary to doBeforeEffect() which is executed, e.g., each time a parameter changes (bzr r5698) --- src/sp-lpe-item.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index b6a63e9b9..87e737435 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -362,11 +362,15 @@ void sp_lpe_item_set_path_effect(SPLPEItem *lpeitem, gchar *value, bool reset) SP_OBJECT_REPR(lpeitem)->setAttribute("inkscape:path-effect", value); // Ask the path effect to reset itself if it doesn't have parameters yet - if (lpeitem->path_effect_ref && reset) { + if (lpeitem->path_effect_ref) { LivePathEffectObject *lpeobj = lpeitem->path_effect_ref->lpeobject; if (lpeobj && lpeobj->lpe) { - // has to be called when all the subitems have their lpes applied - lpeobj->lpe->resetDefaults(lpeitem); + if(reset) { + // has to be called when all the subitems have their lpes applied + lpeobj->lpe->resetDefaults(lpeitem); + } + // perform this once when the effect is applied + lpeobj->lpe->doOnApply(SP_LPE_ITEM(lpeitem)); } } -- cgit v1.2.3