diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-07-09 19:36:07 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-07-09 19:37:16 +0200 |
| commit | ac2304c3cb37dcde2c5a91ddd1e19f788ce3896f (patch) | |
| tree | eb4c25965ab9735a7dbc7a76da1a28c22f6caa07 /src/wx/dcp_timeline.cc | |
| parent | 620d3c8db23704b69fc593bd470e7827daa11d86 (diff) | |
Add DCPTimeline::position_to_reel_boundary().
Diffstat (limited to 'src/wx/dcp_timeline.cc')
| -rw-r--r-- | src/wx/dcp_timeline.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wx/dcp_timeline.cc b/src/wx/dcp_timeline.cc index 680118422..e25f93484 100644 --- a/src/wx/dcp_timeline.cc +++ b/src/wx/dcp_timeline.cc @@ -462,7 +462,13 @@ DCPTimeline::setup_pixels_per_second() shared_ptr<ReelBoundary> DCPTimeline::event_to_reel_boundary(wxMouseEvent& ev) const { - Position<int> const position(ev.GetX(), ev.GetY()); + return position_to_reel_boundary({ev.GetX(), ev.GetY()}); +} + + +shared_ptr<ReelBoundary> +DCPTimeline::position_to_reel_boundary(Position<int> position) const +{ auto iter = std::find_if(_reel_boundaries.begin(), _reel_boundaries.end(), [position](shared_ptr<const ReelBoundary> boundary) { return boundary->view().bbox().contains(position); }); |
