diff options
author | nick_m <mainsbridge@gmail.com> | 2017-03-07 10:36:48 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2017-03-07 10:36:48 +1100 |
commit | 028b042d2a71034c6529e972bfee93a458237c2c (patch) | |
tree | 72302e256939ad190959c5ad78cf08043259fb00 /gtk2_ardour/editor_drag.cc | |
parent | 7bada83a3f4dccefc10a7e6f3627189654e85a41 (diff) |
snapped pencil drawing of new midi regions cannot be zero (7271).
- fixes a couple of other oddities in the behaviour.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 062bb14043..7e18d79e0a 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2426,14 +2426,16 @@ RegionCreateDrag::RegionCreateDrag (Editor* e, ArdourCanvas::Item* i, TimeAxisVi void RegionCreateDrag::motion (GdkEvent* event, bool first_move) { + if (first_move) { _editor->begin_reversible_command (_("create region")); _region = add_midi_region (_view, false); _view->playlist()->freeze (); } else { + if (_region) { framepos_t const f = adjusted_current_frame (event); - if (f < grab_frame()) { + if (f <= grab_frame()) { _region->set_initial_position (f); } @@ -2443,9 +2445,10 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move) a bit confusing as if a region starts 1 frame after a snap point, one cannot place snapped notes at the start of the region. */ - - framecnt_t const len = (framecnt_t) fabs ((double)(f - grab_frame () - 1)); - _region->set_length (len < 1 ? 1 : len, _editor->get_grid_music_divisions (event->button.state)); + if (f != grab_frame()) { + framecnt_t const len = (framecnt_t) fabs ((double)(f - grab_frame () - 1)); + _region->set_length (len < 1 ? 1 : len, _editor->get_grid_music_divisions (event->button.state)); + } } } } |