summaryrefslogtreecommitdiffstats
path: root/src/select-context.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-07-21 03:36:25 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-07-21 03:36:25 +0000
commit9c7757e7fc10db2004c188a7aff95ab54b0e80d6 (patch)
tree88ddb04c252ac2377cf061fdcb8f1ebbfcff16ce /src/select-context.cpp
parentFix for 960240 : Rename Edit:Find to Find Replace (diff)
downloadinkscape-9c7757e7fc10db2004c188a7aff95ab54b0e80d6.tar.gz
inkscape-9c7757e7fc10db2004c188a7aff95ab54b0e80d6.zip
Fix for 816496 : Alt+mouse wheel z-order cycling, add option to cycle wrap
(bzr r11561)
Diffstat (limited to 'src/select-context.cpp')
-rw-r--r--src/select-context.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 91e0e6298..4555e51aa 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -122,6 +122,7 @@ sp_select_context_init(SPSelectContext *sc)
sc->cycling_items_cmp = NULL;
sc->cycling_items_selected_before = NULL;
sc->cycling_cur_item = NULL;
+ sc->cycling_wrap = true;
sc->_seltrans = NULL;
sc->_describer = NULL;
@@ -457,15 +458,17 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection *
GList *next;
if (scroll_event->direction == GDK_SCROLL_UP) {
next = sc->cycling_cur_item->next;
- if (next == NULL)
+ if (next == NULL && sc->cycling_wrap)
next = sc->cycling_items;
} else {
next = sc->cycling_cur_item->prev;
- if (next == NULL)
+ if (next == NULL && sc->cycling_wrap)
next = g_list_last(sc->cycling_items);
}
- sc->cycling_cur_item = next;
- item = SP_ITEM(sc->cycling_cur_item->data);
+ if (next) {
+ sc->cycling_cur_item = next;
+ item = SP_ITEM(sc->cycling_cur_item->data);
+ }
arenaitem = item->get_arenaitem(desktop->dkey);
arenaitem->setOpacity(1.0);
@@ -856,6 +859,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
sc->cycling_cur_item = g_list_last(sc->cycling_items);
}
+ sc->cycling_wrap = prefs->getBool("/options/selection/cycleWrap", true);
+
// Cycle through the items underneath the mouse pointer, one-by-one
sp_select_context_cycle_through_items(sc, selection, scroll_event, shift_pressed);