From 0d30e51220c1447e45ebcfbe9134aa424e77a576 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 2 May 2016 10:08:24 -0400 Subject: [PATCH] When starting a scrub, limit the x coordinate to track control area. --- src/tracks/ui/Scrubbing.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tracks/ui/Scrubbing.cpp b/src/tracks/ui/Scrubbing.cpp index e45b7763b..681466839 100644 --- a/src/tracks/ui/Scrubbing.cpp +++ b/src/tracks/ui/Scrubbing.cpp @@ -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) {