1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-19 09:30:52 +02:00

Bug1387: enable autoscrolling even when the track extends beyond the screen

This commit is contained in:
Paul Licameli 2016-05-04 21:03:44 -04:00
parent 0a0cbbba20
commit ba0b5a70a3

View File

@ -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,