From 704c6e2c0a7a1328da051ade22e7989175a23bdd Mon Sep 17 00:00:00 2001 From: Valeriy Kamyshniy Date: Tue, 27 May 2014 21:19:17 -0400 Subject: [PATCH] [P4/git history rebuild] further changes related to this codebase missing Ardour canvas autoscroll commits. Hopefully to be undone later by commits from a merge by Paul and Grygorii --- gtk2_ardour/editor_drag.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d451ef4aa9..56879fbaa0 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -361,16 +361,16 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll) if (event->motion.state & Gdk::BUTTON1_MASK || event->motion.state & Gdk::BUTTON2_MASK) { if (!from_autoscroll) { - _editor->maybe_autoscroll (true, allow_vertical_autoscroll (), false); + bool const moving_left = _drags->current_pointer_x() < _last_pointer_x; + bool const moving_up = _drags->current_pointer_y() < _last_pointer_y; + _editor->maybe_autoscroll (true, allow_vertical_autoscroll (), moving_left, moving_up); } - if (!_editor->autoscroll_active() || from_autoscroll) { - motion (event, _move_threshold_passed != old_move_threshold_passed); - - _last_pointer_x = _drags->current_pointer_x (); - _last_pointer_y = _drags->current_pointer_y (); - _last_pointer_frame = adjusted_current_frame (event); - } + motion (event, _move_threshold_passed != old_move_threshold_passed); + + _last_pointer_x = _drags->current_pointer_x (); + _last_pointer_y = _drags->current_pointer_y (); + _last_pointer_frame = adjusted_current_frame (event); return true; } @@ -3912,7 +3912,9 @@ SelectionDrag::motion (GdkEvent* event, bool first_move) break; } - _editor->maybe_autoscroll (true, false, false); + if (event->button.x >= _editor->horizontal_position() + _editor->_visible_canvas_width) { + _editor->start_canvas_autoscroll (1, 0); + } if (start != end) { switch (_operation) { @@ -4101,7 +4103,9 @@ RangeMarkerBarDrag::motion (GdkEvent* event, bool first_move) } } - _editor->maybe_autoscroll (true, false, false); + if (event->button.x >= _editor->horizontal_position() + _editor->_visible_canvas_width) { + _editor->start_canvas_autoscroll (1, 0); + } if (start != end) { _editor->temp_location->set (start, end);