summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/select-tool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/tools/select-tool.cpp')
-rw-r--r--src/ui/tools/select-tool.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index 2b85216d2..905e38f2b 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -405,13 +405,15 @@ void SelectTool::sp_select_context_cycle_through_items(Inkscape::Selection *sele
// Find next item and activate it
std::vector<SPItem *>::iterator next = this->cycling_cur_item;
if (scroll_event->direction == GDK_SCROLL_UP) {
- next++;
- if (next == this->cycling_items.end() && this->cycling_wrap)
+ ++next;
+ if (next == this->cycling_items.end() && this->cycling_wrap) {
next = this->cycling_items.begin();
+ }
} else {
- if(next == this->cycling_items.begin())
+ if(next == this->cycling_items.begin()) {
next = this->cycling_items.end();
- next--;
+ }
+ --next;
}
if (next!=this->cycling_items.end()) {