From ba0b5a70a3e27cf76e5ff61b3f1023b895c65cbf Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 4 May 2016 21:03:44 -0400 Subject: [PATCH] Bug1387: enable autoscrolling even when the track extends beyond the screen --- src/TrackPanel.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 9e0cd9bbf..8e15cd78a 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1015,6 +1015,25 @@ void TrackPanel::ScrollDuringDrag() mAutoScrolling = true; mListener->TP_ScrollLeft(); } + else { + // Bug1387: enable autoscroll during drag, if the pointer is at either extreme x + // coordinate of the screen, even if that is still within the track area. + + int xx = mMouseMostRecentX, yy = 0; + this->ClientToScreen(&xx, &yy); + if (xx == 0) { + mAutoScrolling = true; + mListener->TP_ScrollLeft(); + } + else { + int width, height; + ::wxDisplaySize(&width, &height); + if (xx == width - 1) { + mAutoScrolling = true; + mListener->TP_ScrollRight(); + } + } + } if (mAutoScrolling) { // AS: To keep the selection working properly as we scroll,