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) {