Prevent note trim to zero length (shown as stuck).
The reasonable value 1 tick doesn't seem to work here, presumably it gets lost in rounding conversion somewhere. Instead use a really small power of two reciprocal. Once we use actual beats and ticks we can fix this to be a minimum of one tick (the actual minimum length for a note).
This commit is contained in:
parent
3f34f0a0a4
commit
57947ff5a8
@ -2693,6 +2693,8 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
||||
}
|
||||
}
|
||||
|
||||
len = std::max(Evoral::Beats(1 / 512.0), len);
|
||||
|
||||
char buf[16];
|
||||
snprintf (buf, sizeof (buf), "%.3g beats", len.to_double());
|
||||
show_verbose_cursor (buf, 0, 0);
|
||||
@ -2761,13 +2763,10 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
||||
}
|
||||
|
||||
if (!at_front) {
|
||||
const Evoral::Beats len = x_beats - canvas_note->note()->time();
|
||||
|
||||
if (!!len) {
|
||||
/* XXX convert to beats */
|
||||
const Evoral::Beats len = std::max(Evoral::Beats(1 / 512.0),
|
||||
x_beats - canvas_note->note()->time());
|
||||
note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len);
|
||||
}
|
||||
}
|
||||
|
||||
delete resize_rect;
|
||||
delete (*i);
|
||||
|
Loading…
Reference in New Issue
Block a user