From ef015702fb970b78c473dfe4b3f7ae9100ea453c Mon Sep 17 00:00:00 2001 From: bulia byak Date: Fri, 24 Nov 2006 07:00:57 +0000 Subject: grow/shrink node selection by scrollwheel (bzr r2026) --- src/nodepath.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/nodepath.cpp') diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 59a6bcce3..e58a8b31d 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -2864,6 +2864,33 @@ static gboolean node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::No case GDK_LEAVE_NOTIFY: active_node = NULL; break; + case GDK_SCROLL: + if ((event->scroll.state & GDK_CONTROL_MASK) && !(event->scroll.state & GDK_SHIFT_MASK)) { // linearly + switch (event->scroll.direction) { + case GDK_SCROLL_UP: + nodepath_grow_selection_linearly (n->subpath->nodepath, n, +1); + break; + case GDK_SCROLL_DOWN: + nodepath_grow_selection_linearly (n->subpath->nodepath, n, -1); + break; + default: + break; + } + ret = TRUE; + } else if (!(event->scroll.state & GDK_SHIFT_MASK)) { // spatially + switch (event->scroll.direction) { + case GDK_SCROLL_UP: + nodepath_grow_selection_spatially (n->subpath->nodepath, n, +1); + break; + case GDK_SCROLL_DOWN: + nodepath_grow_selection_spatially (n->subpath->nodepath, n, -1); + break; + default: + break; + } + ret = TRUE; + } + break; case GDK_KEY_PRESS: switch (get_group0_keyval (&event->key)) { case GDK_space: @@ -2875,16 +2902,16 @@ static gboolean node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::No break; case GDK_Page_Up: if (event->key.state & GDK_CONTROL_MASK) { - nodepath_grow_selection_spatially (n->subpath->nodepath, n, +1); - } else { nodepath_grow_selection_linearly (n->subpath->nodepath, n, +1); + } else { + nodepath_grow_selection_spatially (n->subpath->nodepath, n, +1); } break; case GDK_Page_Down: if (event->key.state & GDK_CONTROL_MASK) { - nodepath_grow_selection_spatially (n->subpath->nodepath, n, -1); - } else { nodepath_grow_selection_linearly (n->subpath->nodepath, n, -1); + } else { + nodepath_grow_selection_spatially (n->subpath->nodepath, n, -1); } break; default: -- cgit v1.2.3