diff options
Diffstat (limited to 'src')
| -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; |
