summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-30 21:33:32 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-30 21:33:32 +0000
commit664cec21359ba055243c3feaf47c6eb16fccbb3b (patch)
tree8a0fa5b385f2fa57b818910a97a7194523efa628 /gtk2_ardour/editor_canvas.cc
parent8d0f685d521e0bba07b0beb510518e8f6bffb209 (diff)
Don't autoscroll right if we are moving left, and vice versa; should fix #4676.
git-svn-id: svn://localhost/ardour2/branches/3.0@11393 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 6da76503a7..9a990b4dc3 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -491,8 +491,15 @@ Editor::autoscroll_fudge_threshold () const
return current_page_frames() / 6;
}
+/** @param allow_horiz true to allow horizontal autoscroll, otherwise false.
+ * @param allow_vert true to allow vertical autoscroll, otherwise false.
+ * @param moving_left true if we are moving left, so we only want to autoscroll on the left of the canvas,
+ * otherwise false, so we only want to autoscroll on the right of the canvas.
+ * @param moving_up true if we are moving up, so we only want to autoscroll at the top of the canvas,
+ * otherwise false, so we only want to autoscroll at the bottom of the canvas.
+ */
void
-Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert)
+Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool moving_left, bool moving_up)
{
bool startit = false;
@@ -522,10 +529,10 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert)
autoscroll_y = 0;
autoscroll_x = 0;
- if (ty < canvas_timebars_vsize && allow_vert) {
+ if (ty < canvas_timebars_vsize && moving_up && allow_vert) {
autoscroll_y = -1;
startit = true;
- } else if (ty > _canvas_height && allow_vert) {
+ } else if (ty > _canvas_height && !moving_up && allow_vert) {
autoscroll_y = 1;
startit = true;
}
@@ -536,12 +543,12 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert)
}
if (_drags->current_pointer_frame() > rightmost_frame && allow_horiz) {
- if (rightmost_frame < max_framepos) {
+ if (rightmost_frame < max_framepos && !moving_left) {
autoscroll_x = 1;
startit = true;
}
} else if (_drags->current_pointer_frame() < leftmost_frame && allow_horiz) {
- if (leftmost_frame > 0) {
+ if (leftmost_frame > 0 && moving_left) {
autoscroll_x = -1;
startit = true;
}