mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 14:20:06 +02:00
Don't hit any TrackPanel or Ruler cells when mouse is out of window
This commit is contained in:
parent
74efec9d39
commit
2c28af05e8
@ -2087,15 +2087,13 @@ auto TrackPanel::FindCell(int mouseX, int mouseY) -> FoundCell
|
|||||||
{
|
{
|
||||||
auto range = Cells();
|
auto range = Cells();
|
||||||
auto &iter = range.first, &end = range.second;
|
auto &iter = range.first, &end = range.second;
|
||||||
auto prev = iter;
|
|
||||||
while
|
while
|
||||||
( iter != end &&
|
( iter != end &&
|
||||||
!(*iter).second.Contains( mouseX, mouseY ) )
|
!(*iter).second.Contains( mouseX, mouseY ) )
|
||||||
prev = iter++;
|
++iter;
|
||||||
if ( iter == end )
|
if (iter == end)
|
||||||
// Default to the background cell, which is always last in the sequence,
|
return {};
|
||||||
// even if it does not contain the point
|
|
||||||
iter = prev;
|
|
||||||
auto found = *iter;
|
auto found = *iter;
|
||||||
return {
|
return {
|
||||||
found.first,
|
found.first,
|
||||||
|
@ -3606,7 +3606,10 @@ auto AdornedRulerPanel::FindCell(int mouseX, int mouseY) -> FoundCell
|
|||||||
if (mayScrub && mScrubZone.Contains(mouseX, mouseY))
|
if (mayScrub && mScrubZone.Contains(mouseX, mouseY))
|
||||||
return { mScrubbingCell, mScrubZone };
|
return { mScrubbingCell, mScrubZone };
|
||||||
|
|
||||||
return { mQPCell, mInner };
|
if (mInner.Contains(mouseX, mouseY))
|
||||||
|
return { mQPCell, mInner };
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect AdornedRulerPanel::FindRect(const TrackPanelCell &cell)
|
wxRect AdornedRulerPanel::FindRect(const TrackPanelCell &cell)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user