diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-13 02:00:51 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-06-13 02:00:51 +0000 |
commit | 5573b6a049646fd0fe10d4d79f98cf272ee1f107 (patch) | |
tree | aea758890962f233ab1c45cfa4f7f40faa4415a9 /gtk2_ardour/editor_drag.cc | |
parent | 0d002fb231a0a4f8965abb8afba389b4cb3fe35e (diff) |
fix some bugs with dragging patch/program changes around
git-svn-id: svn://localhost/ardour2/branches/3.0@12692 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 7517bb0249..ce785af188 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4309,7 +4309,9 @@ PatchChangeDrag::PatchChangeDrag (Editor* e, CanvasPatchChange* i, MidiRegionVie , _patch_change (i) , _cumulative_dx (0) { - DEBUG_TRACE (DEBUG::Drags, "New PatchChangeDrag\n"); + DEBUG_TRACE (DEBUG::Drags, string_compose ("New PatchChangeDrag, patch @ %1, grab @ %2\n", + _region_view->source_beats_to_absolute_frames (_patch_change->patch()->time()), + grab_frame())); } void @@ -4320,8 +4322,8 @@ PatchChangeDrag::motion (GdkEvent* ev, bool) f = max (f, r->position ()); f = min (f, r->last_frame ()); - framecnt_t const dxf = f - grab_frame(); - double const dxu = _editor->frame_to_unit (dxf); + framecnt_t const dxf = f - grab_frame(); // permitted dx in frames + double const dxu = _editor->frame_to_unit (dxf); // permitted fx in units _patch_change->move (dxu - _cumulative_dx, 0); _cumulative_dx = dxu; } @@ -4334,14 +4336,13 @@ PatchChangeDrag::finished (GdkEvent* ev, bool movement_occurred) } boost::shared_ptr<Region> r (_region_view->region ()); - framepos_t f = adjusted_current_frame (ev); f = max (f, r->position ()); f = min (f, r->last_frame ()); _region_view->move_patch_change ( *_patch_change, - _region_view->region_frames_to_region_beats (f - r->position() - r->start()) + _region_view->region_frames_to_region_beats (f - (r->position() - r->start())) ); } |