13
0

midi note drawing: use RoundNearest not RoundDownMaybe for note ends

This commit is contained in:
Paul Davis 2022-09-22 16:21:07 -06:00
parent 04d367fdfe
commit 2e0bfae628
2 changed files with 5 additions and 5 deletions

View File

@ -6699,10 +6699,10 @@ NoteCreateDrag::~NoteCreateDrag ()
}
Temporal::Beats
NoteCreateDrag::round_down_to_grid (timepos_t const & pos, GdkEvent const * event) const
NoteCreateDrag::round_to_grid (timepos_t const & pos, GdkEvent const * event) const
{
timepos_t snapped = pos;
_editor->snap_to (snapped, RoundDownMaybe, SnapToGrid_Scaled);
_editor->snap_to (snapped, RoundNearest, SnapToGrid_Scaled);
return snapped.beats();
}
@ -6714,7 +6714,7 @@ NoteCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
_drag_rect = new ArdourCanvas::Rectangle (_region_view->get_canvas_group ());
const timepos_t pos = _drags->current_pointer_time ();
Temporal::Beats aligned_beats (round_down_to_grid (pos, event));
Temporal::Beats aligned_beats (round_to_grid (pos, event));
const Temporal::Beats grid_beats (_region_view->get_draw_length_beats (pos));
_note[0] = timepos_t (aligned_beats);
@ -6743,7 +6743,7 @@ void
NoteCreateDrag::motion (GdkEvent* event, bool)
{
const timepos_t pos = _drags->current_pointer_time ();
Temporal::Beats aligned_beats = round_down_to_grid (pos, event);
Temporal::Beats aligned_beats = round_to_grid (pos, event);
//when the user clicks and starts a drag to define the note's length, require notes to be at least |this| long
const Temporal::Beats min_length (_region_view->get_draw_length_beats (pos));

View File

@ -655,7 +655,7 @@ public:
private:
double y_to_region (double) const;
Temporal::Beats round_down_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
/** @return minimum number of samples (in x) and pixels (in y) that should be considered a movement */
std::pair<Temporal::timecnt_t,int> move_threshold () const {