1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-06 06:17:37 +02:00

nonvirtual reimplementation of CellularPanel::FindRect using nodes

This commit is contained in:
Paul Licameli
2018-09-17 18:28:39 -04:00
parent cfa7afcb24
commit 01551913f0
6 changed files with 19 additions and 32 deletions

View File

@@ -1014,6 +1014,20 @@ auto CellularPanel::FindCell(int mouseX, int mouseY) -> FoundCell
return { {}, {} };
}
wxRect CellularPanel::FindRect( const TrackPanelCell &cell )
{
wxRect result;
struct Stop{};
try { VisitCells( [&]( const wxRect &rect, TrackPanelCell &visited ) {
if ( &visited == &cell )
result = rect, throw Stop{};
} ); }
catch ( const Stop& ) {}
return result;
}
UIHandlePtr CellularPanel::Target()
{
auto &state = *mState;