Fix timeline zoom oddities after dragging a very small zoom rectangle.
[dcpomatic.git] / src / wx / timeline.cc
index 89f2239569edea9cf9e8b79f325381e119ec460b..3187792bea4ea30545341917ea72a063f43f4a55 100644 (file)
@@ -112,7 +112,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, w
        _main_canvas->Bind   (wxEVT_SCROLLWIN_PAGEDOWN,   boost::bind (&Timeline::scrolled,     this, _1));
        _main_canvas->Bind   (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled,     this, _1));
 
-       film_change (ChangeType::DONE, Film::CONTENT);
+       film_change (ChangeType::DONE, Film::Property::CONTENT);
 
        SetMinSize (wxSize (640, 4 * pixels_per_track() + 96));
 
@@ -182,7 +182,7 @@ Timeline::paint_main ()
                list<dcpomatic::Rect<int>> overlaps;
                for (auto j: _views) {
                        auto jc = dynamic_pointer_cast<TimelineContentView> (j);
-                       /* No overlap with non-content views, views no different tracks, audio views or non-active views */
+                       /* No overlap with non-content views, views on different tracks, audio views or non-active views */
                        if (!ic || !jc || i == j || ic->track() != jc->track() || ic->track().get_value_or(2) >= 2 || !ic->active() || !jc->active()) {
                                continue;
                        }
@@ -231,10 +231,10 @@ Timeline::film_change (ChangeType type, Film::Property p)
                return;
        }
 
-       if (p == Film::CONTENT || p == Film::REEL_TYPE || p == Film::REEL_LENGTH) {
+       if (p == Film::Property::CONTENT || p == Film::Property::REEL_TYPE || p == Film::Property::REEL_LENGTH) {
                ensure_ui_thread ();
                recreate_views ();
-       } else if (p == Film::CONTENT_ORDER) {
+       } else if (p == Film::Property::CONTENT_ORDER) {
                Refresh ();
        }
 }
@@ -625,6 +625,8 @@ Timeline::left_up_zoom (wxMouseEvent& ev)
 
        if ((bottom_right.x - top_left.x) < 8 || (bottom_right.y - top_left.y) < 8) {
                /* Very small zoom rectangle: we assume it wasn't intentional */
+               _zoom_point = optional<wxPoint> ();
+               Refresh ();
                return;
        }