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 | |
| parent | 620d3c8db23704b69fc593bd470e7827daa11d86 (diff) | |
Add DCPTimeline::position_to_reel_boundary().
| -rw-r--r-- | src/wx/dcp_timeline.cc | 8 | ||||
| -rw-r--r-- | src/wx/dcp_timeline.h | 1 |
2 files changed, 8 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); }); diff --git a/src/wx/dcp_timeline.h b/src/wx/dcp_timeline.h index 23644c03f..6abb72d63 100644 --- a/src/wx/dcp_timeline.h +++ b/src/wx/dcp_timeline.h @@ -69,6 +69,7 @@ private: void setup_reel_settings(); void setup_reel_boundaries(); std::shared_ptr<ReelBoundary> event_to_reel_boundary(wxMouseEvent& ev) const; + std::shared_ptr<ReelBoundary> position_to_reel_boundary(Position<int> position) const; void set_reel_boundary(int index, dcpomatic::DCPTime time); bool editable() const; |
