Fix snap to butt up rather than giving a slight overlap.
authorCarl Hetherington <cth@carlh.net>
Thu, 23 Oct 2014 20:30:39 +0000 (21:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 23 Oct 2014 20:30:39 +0000 (21:30 +0100)
src/wx/timeline.cc

index eba12c47faff1421269b2f42067ec09ce90c8d6a..2e368e57d7b6373740efc865e895f0a0538aae79 100644 (file)
@@ -647,7 +647,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                                Time const d = abs (cv->content()->end() - new_position);
                                if (first || d < nearest_distance) {
                                        nearest_distance = d;
-                                       nearest_new_position = cv->content()->end();
+                                       nearest_new_position = cv->content()->end() + 1;
                                }
                        }
                        
@@ -656,7 +656,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                                Time const d = abs (cv->content()->position() - (new_position + _down_view->content()->length_after_trim()));
                                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 () - 1;
                                }
                        }