diff options
| author | bulia byak <buliabyak@gmail.com> | 2009-06-10 22:32:57 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2009-06-10 22:32:57 +0000 |
| commit | 9d68fc08e56ed1115ed604ce152c9fb8fac0c1f8 (patch) | |
| tree | df9df7859729a44336724882909604b5003a4e97 /src/node-context.cpp | |
| parent | Minor French translation update. (diff) | |
| download | inkscape-9d68fc08e56ed1115ed604ce152c9fb8fac0c1f8.tar.gz inkscape-9d68fc08e56ed1115ed604ce152c9fb8fac0c1f8.zip | |
disable helperpath flashing for texts but enable it for grouped paths
(bzr r8042)
Diffstat (limited to '')
| -rw-r--r-- | src/node-context.cpp | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/src/node-context.cpp b/src/node-context.cpp index a28e0d6bc..6ad7b85d4 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -230,27 +230,46 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve { gint ret = FALSE; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + SPDesktop *desktop = event_context->desktop; - if (prefs->getBool("/tools/nodes/pathflash_enabled")) { - if (prefs->getBool("/tools/nodes/pathflash_unselected")) { - SPDesktop *desktop = event_context->desktop; - ShapeEditor* se = event_context->shape_editor; - Inkscape::Selection *selection = sp_desktop_selection (desktop); - if (se->has_nodepath() && selection->singleItem()) { - return ret; - } - } - if (SP_IS_LPE_ITEM(item)) { - Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)); - 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; + switch (event->type) { + case GDK_MOTION_NOTIFY: + { + // find out actual item we're over, disregarding groups + SPItem *actual_item = sp_event_context_find_item (desktop, + Geom::Point(event->button.x, event->button.y), FALSE, TRUE); + if (!actual_item) + break; + + + if (prefs->getBool("/tools/nodes/pathflash_enabled")) { + if (prefs->getBool("/tools/nodes/pathflash_unselected")) { + // do not flash if we have some path selected and a single item in selection (i.e. it + // is the same path that we're editing) + SPDesktop *desktop = event_context->desktop; + ShapeEditor* se = event_context->shape_editor; + Inkscape::Selection *selection = sp_desktop_selection (desktop); + if (se->has_nodepath() && selection->singleItem()) { + break; + } + } + if (SP_IS_LPE_ITEM(actual_item)) { + Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(actual_item)); + 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() + break; + } + } + guint timeout = prefs->getInt("/tools/nodes/pathflash_timeout", 500); + sp_node_context_flash_path(event_context, actual_item, timeout); } } - guint timeout = prefs->getInt("/tools/nodes/pathflash_timeout", 500); - sp_node_context_flash_path(event_context, item, timeout); + break; + + default: + break; } if (((SPEventContextClass *) parent_class)->item_handler) |
