Update TO_PORT.
[dcpomatic.git] / src / wx / timeline.cc
index 13baef6b7bb0c143021aeb67a97fe7dcc714127e..6bce881a42013f0eba980723aca09e95e8f6505e 100644 (file)
@@ -96,7 +96,7 @@ public:
 
        dcpomatic::Rect<int> bbox () const
        {
-               assert (_track);
+               DCPOMATIC_ASSERT (_track);
 
                shared_ptr<const Film> film = _timeline.film ();
                shared_ptr<const Content> content = _content.lock ();
@@ -145,7 +145,7 @@ private:
 
        void do_paint (wxGraphicsContext* gc)
        {
-               assert (_track);
+               DCPOMATIC_ASSERT (_track);
 
                shared_ptr<const Film> film = _timeline.film ();
                shared_ptr<const Content> cont = content ();
@@ -715,7 +715,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                                DCPTime const d = DCPTime (cv->content()->end() - new_position).abs ();
                                if (first || d < nearest_distance) {
                                        nearest_distance = d;
-                                       nearest_new_position = cv->content()->end();
+                                       nearest_new_position = cv->content()->end() + DCPTime::delta ();
                                }
                        }
                        
@@ -727,7 +727,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                                
                                if (d < nearest_distance) {
                                        nearest_distance = d;
-                                       nearest_new_position = cv->content()->position() - _down_view->content()->length_after_trim ();
+                                       nearest_new_position = cv->content()->position() - _down_view->content()->length_after_trim () - DCPTime::delta();
                                }
                        }
                        
@@ -749,7 +749,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
        _down_view->content()->set_position (new_position);
        
        shared_ptr<Film> film = _film.lock ();
-       assert (film);
+       DCPOMATIC_ASSERT (film);
        film->set_sequence_video (false);
 }