mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-16 15:57:52 +01:00
Another override of CellularPanel::FindRect taking a predicate
This commit is contained in:
@@ -1043,6 +1043,21 @@ wxRect CellularPanel::FindRect( const TrackPanelCell &cell )
|
||||
return result;
|
||||
}
|
||||
|
||||
wxRect CellularPanel::FindRect(
|
||||
const std::function< bool( TrackPanelNode& ) > &pred)
|
||||
{
|
||||
wxRect result;
|
||||
|
||||
struct Stop{};
|
||||
try { VisitPreorder( [&]( const wxRect &rect, TrackPanelNode &visited ) {
|
||||
if ( pred( visited ) )
|
||||
result = rect, throw Stop{};
|
||||
} ); }
|
||||
catch ( const Stop& ) {}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
UIHandlePtr CellularPanel::Target()
|
||||
{
|
||||
auto &state = *mState;
|
||||
|
||||
Reference in New Issue
Block a user