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:
commit
d38c237a15
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user