summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-30 13:41:16 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-30 13:41:16 +0000
commit42aea0b9fd7877420b58233c7c5979c04a02b1f1 (patch)
tree863d264d1d4a93465ea276b2ee2f75547120f5c8 /gtk2_ardour/editor_drag.cc
parent976e16340615caa446bf2d1987ced37118e249b3 (diff)
Clean up comments to create_note_at, since it no longers snaps its length parameter. Move the 1 tick shortening out of the method for the same reason. Make sure that create drags make notes with a minimum length of 1 tick (#4600).
git-svn-id: svn://localhost/ardour2/branches/3.0@11116 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index d03084e2d0..02e5f91f7d 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -4446,11 +4446,15 @@ NoteCreateDrag::finished (GdkEvent* event, bool had_movement)
framecnt_t length = abs (_note[0] - _note[1]);
framecnt_t const g = grid_frames (start);
+ double const one_tick = 1 / Timecode::BBT_Time::ticks_per_bar_division;
+
if (_editor->snap_mode() == SnapNormal && length < g) {
- length = g;
+ length = g - one_tick;
}
- _region_view->create_note_at (start, _drag_rect->property_y1(), _region_view->region_frames_to_region_beats (length), true, false);
+ double const length_beats = max (one_tick, _region_view->region_frames_to_region_beats (length));
+
+ _region_view->create_note_at (start, _drag_rect->property_y1(), length_beats, false);
}
double