From f755174c5f7195a38830ef76d6756e4da9dd63d1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 4 Jul 2021 09:43:36 -0600 Subject: [PATCH] fix timeline type use --- gtk2_ardour/editor_drag.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 6a5b8b59a5..d9b85dd841 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -7321,23 +7321,24 @@ RegionMarkerDrag::start_grab (GdkEvent* ev, Gdk::Cursor* c) { Drag::start_grab (ev, c); show_verbose_cursor_time (model.position()); - setup_snap_delta (MusicSample (model.position(), 0)); + setup_snap_delta (model.position()); } void RegionMarkerDrag::motion (GdkEvent* ev, bool first_move) { - samplepos_t pos = adjusted_current_sample (ev); + timepos_t pos = adjusted_current_time (ev); if (pos < rv->region()->position() || pos >= (rv->region()->position() + rv->region()->length())) { /* out of bounds */ return; } - dragging_model.set_position (pos - rv->region()->position()); + timepos_t newpos (rv->region()->position().distance (pos)); + dragging_model.set_position (newpos); /* view (ArdourMarker) needs a relative position inside the RegionView */ - view->set_position (pos - rv->region()->position()); - show_verbose_cursor_time (dragging_model.position() - rv->region()->position()); /* earlier */ + view->set_position (newpos); + show_verbose_cursor_time (newpos); } void