1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 06:40:08 +02:00

When starting a scrub, limit the x coordinate to track control area.

This commit is contained in:
Paul Licameli 2016-05-02 10:08:24 -04:00
parent 60e3791a22
commit 0d30e51220

View File

@ -656,6 +656,13 @@ void Scrubber::DoScrub(bool scroll, bool seek)
if (!wasScrubbing) {
auto tp = mProject->GetTrackPanel();
wxCoord xx = tp->ScreenToClient(::wxGetMouseState().GetPosition()).x;
// Limit x
int width;
tp->GetTracksUsableArea(&width, nullptr);
const auto offset = tp->GetLeftOffset();
xx = (std::max(offset, std::min(offset + width - 1, xx)));
MarkScrubStart(xx, scroll, seek);
}
else if(!match) {