diff options
author | Carl Hetherington <carl@carlh.net> | 2011-07-02 22:13:19 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-07-02 22:13:19 +0000 |
commit | deef858857450e8cbf7ec9e325cb4516495f21a1 (patch) | |
tree | 631a44aabe66148debda05ab0f167acbd596db9b | |
parent | c78f388edfd3ea3e5e4c78edfc8a64d0f597338e (diff) |
Fix erroneous note resizing in regions with non-zero start (#4143).
git-svn-id: svn://localhost/ardour2/branches/3.0@9785 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 7d585aceb7..b873ea884d 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2461,6 +2461,11 @@ MidiRegionView::commit_resizing (ArdourCanvas::CanvasNoteEvent* primary, bool at for (std::vector<NoteResizeData *>::iterator i = _resize_data.begin(); i != _resize_data.end(); ++i) { CanvasNote* canvas_note = (*i)->canvas_note; SimpleRect* resize_rect = (*i)->resize_rect; + + /* Get the new x position for this resize, which is in pixels relative + * to the region position. + */ + double current_x; if (at_front) { @@ -2477,7 +2482,10 @@ MidiRegionView::commit_resizing (ArdourCanvas::CanvasNoteEvent* primary, bool at } } - current_x = snap_pixel_to_frame (current_x); + /* Convert that to a frame within the region */ + current_x = snap_pixel_to_frame (current_x) + _region->start (); + + /* and then to beats */ current_x = frames_to_beats (current_x); if (at_front && current_x < canvas_note->note()->end_time()) { |