1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01: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

@@ -2088,20 +2088,6 @@ std::shared_ptr<TrackPanelNode> TrackPanel::Root()
return std::make_shared< MainGroup >( *this );
}
wxRect TrackPanel::FindRect( const TrackPanelCell &cell )
{
auto range = Cells();
auto end = range.second,
iter = std::find_if( range.first, end,
[&]( const decltype(*end) &pair )
{ return pair.first.get() == &cell; }
);
if (iter == end)
return {};
else
return (*iter).second;
}
// This finds the rectangle of a given track (including all channels),
// either that of the label 'adornment' or the track itself
// The given track is assumed to be the first channel