summaryrefslogtreecommitdiff
path: root/src/wx/timeline.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-09-08 23:57:03 +0100
committerCarl Hetherington <cth@carlh.net>2019-09-08 23:57:03 +0100
commitc536ea4b470fffadcc491b2b9885e027efa2ec5c (patch)
treea5e7d2755ee22b142e4fed229cb5d2fbb7882895 /src/wx/timeline.cc
parent926b27dd7550dcb103ad7d6c8bbc7d00eb78589b (diff)
Fix timeline selection under scroll.
Diffstat (limited to 'src/wx/timeline.cc')
-rw-r--r--src/wx/timeline.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index cac9318cc..daeeb0a51 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -478,7 +478,11 @@ Timeline::event_to_view (wxMouseEvent& ev)
{
/* Search backwards through views so that we find the uppermost one first */
TimelineViewList::reverse_iterator i = _views.rbegin();
- Position<int> const p (ev.GetX(), ev.GetY());
+
+ int vsx, vsy;
+ _main_canvas->GetViewStart (&vsx, &vsy);
+ Position<int> const p (ev.GetX() + vsx * _x_scroll_rate, ev.GetY() + vsy * _y_scroll_rate);
+
while (i != _views.rend() && !(*i)->bbox().contains (p)) {
shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i);
++i;