From 1bd25dde38abbc12fda5985e2b33be0813a42a9d Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 16 Jun 2008 15:46:06 +0000 Subject: [PATCH] Ditch PERMANENT_FLASH because it is handled by providesOwnFlashPath(); avoid flashing when LPE already provides a helperpath --- src/live_effects/effect.h | 4 +++- src/live_effects/lpe-mirror_reflect.h | 2 -- src/live_effects/lpe-tangent_to_curve.h | 2 -- src/node-context.cpp | 14 +++++--------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 9bcbf51ab..799c4cf75 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -81,7 +81,7 @@ extern const Util::EnumDataConverter LPETypeConverter; enum LPEPathFlashType { SUPPRESS_FLASH, - PERMANENT_FLASH, +// PERMANENT_FLASH, DEFAULT }; @@ -119,6 +119,8 @@ public: // TODO: providesKnotholder() is currently used as an indicator of whether a nodepath is // created for an item or not. When we allow both at the same time, this needs rethinking! bool providesKnotholder() { return (kh_entity_vector.size() > 0); } + // TODO: in view of providesOwnFlashPaths() below, this is somewhat redundant + // (but spiro lpe still needs it!) virtual LPEPathFlashType pathFlashType() { return DEFAULT; } void addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); diff --git a/src/live_effects/lpe-mirror_reflect.h b/src/live_effects/lpe-mirror_reflect.h index b4f7029a0..61745a439 100644 --- a/src/live_effects/lpe-mirror_reflect.h +++ b/src/live_effects/lpe-mirror_reflect.h @@ -31,8 +31,6 @@ public: virtual void acceptParamPath (SPPath *param_path); virtual int acceptsNumParams() { return 2; } - virtual LPEPathFlashType pathFlashType() { return SUPPRESS_FLASH; } - virtual std::vector doEffect_path (std::vector const & path_in); private: diff --git a/src/live_effects/lpe-tangent_to_curve.h b/src/live_effects/lpe-tangent_to_curve.h index 464b692bf..8fe54335c 100644 --- a/src/live_effects/lpe-tangent_to_curve.h +++ b/src/live_effects/lpe-tangent_to_curve.h @@ -38,8 +38,6 @@ public: virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); - virtual LPEPathFlashType pathFlashType() { return SUPPRESS_FLASH; } - /* the knotholder entity classes must be declared friends */ friend class TtC::KnotHolderEntityLeftEnd; friend class TtC::KnotHolderEntityRightEnd; diff --git a/src/node-context.cpp b/src/node-context.cpp index b85e08b68..9a4bff88e 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -236,15 +236,11 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve guint timeout = prefs_get_int_attribute("tools.nodes", "pathflash_timeout", 500); if (SP_IS_LPE_ITEM(item)) { Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)); - if (lpe) { - if (lpe->pathFlashType() == Inkscape::LivePathEffect::SUPPRESS_FLASH) { - // suppressed and permanent flashes for LPE items are handled in - // sp_node_context_selection_changed() - return ret; - } - if (lpe->pathFlashType() == Inkscape::LivePathEffect::PERMANENT_FLASH) { - timeout = 0; - } + if (lpe && (lpe->providesOwnFlashPaths() || + lpe->pathFlashType() == Inkscape::LivePathEffect::SUPPRESS_FLASH)) { + // path should be suppressed or permanent; this is handled in + // sp_node_context_selection_changed() + return ret; } } sp_node_context_flash_path(event_context, item, timeout); -- 2.30.2