From 743e324c6a25a545f7a03bc0c6d16a421116f7f0 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Thu, 7 Jan 2016 15:44:24 +1000 Subject: [PATCH] Remove goto in Editor::track_canvas_scroll --- gtk2_ardour/editor_canvas_events.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index c889de072d..c439bdaaa3 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -72,7 +72,6 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) Duple event_coords = _track_canvas->window_to_canvas (Duple (ev->x, ev->y)); - retry: switch (direction) { case GDK_SCROLL_UP: if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) { @@ -83,8 +82,8 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) zoom_focus = temp_focus; return true; } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { - direction = GDK_SCROLL_LEFT; - goto retry; + scroll_left_step (); + return true; } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) { if (!current_stepping_trackview) { step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500); @@ -112,8 +111,8 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) zoom_focus = temp_focus; return true; } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { - direction = GDK_SCROLL_RIGHT; - goto retry; + scroll_right_step (); + return true; } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) { if (!current_stepping_trackview) { step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500);