Fix timeline selection under scroll.
authorCarl Hetherington <cth@carlh.net>
Sun, 8 Sep 2019 22:57:03 +0000 (23:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 8 Sep 2019 22:57:03 +0000 (23:57 +0100)
src/wx/timeline.cc

index cac9318..daeeb0a 100644 (file)
@@ -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;