mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 08:01:19 +02:00
When starting a scrub, limit the x coordinate to track control area...
... This fixes a display bug if you use a shortcut key for the Scrub command while the mouse is left or right of the wave area. You should not get the green line right at the pointer!
This commit is contained in:
parent
260e8b0879
commit
2704c85fd1
@ -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