mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Allow time shift only when mouse x is within bounds
This commit is contained in:
parent
93e03b5d99
commit
716d3252b3
@ -4076,8 +4076,16 @@ void TrackPanel::DoSlide(wxMouseEvent & event)
|
|||||||
// find which track the mouse is currently in (mouseTrack) -
|
// find which track the mouse is currently in (mouseTrack) -
|
||||||
// this may not be the same as the one we started in...
|
// this may not be the same as the one we started in...
|
||||||
Track *mouseTrack = FindTrack(event.m_x, event.m_y, false, false, NULL);
|
Track *mouseTrack = FindTrack(event.m_x, event.m_y, false, false, NULL);
|
||||||
if (mouseTrack == NULL)
|
if (mouseTrack == NULL) {
|
||||||
mouseTrack = mCapturedTrack;
|
// Allow sliding if the pointer is not over any track, but only if x is
|
||||||
|
// within the bounds of the tracks area.
|
||||||
|
int width, height;
|
||||||
|
GetTracksUsableArea(&width, &height);
|
||||||
|
if (event.m_x >= GetLeftOffset() && event.m_x < GetLeftOffset() + width)
|
||||||
|
mouseTrack = mCapturedTrack;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Start by undoing the current slide amount; everything
|
// Start by undoing the current slide amount; everything
|
||||||
// happens relative to the original horizontal position of
|
// happens relative to the original horizontal position of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user