mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
Piano: Avoid selecting out of range notes.
Fixes #5736. The selected note value could also underflow if you drag to the left, but the assert got triggered only in case you're dragging past the end of the note roll.
This commit is contained in:
parent
ea7bdf02b8
commit
9ea15a84ac
1 changed files with 1 additions and 1 deletions
|
@ -191,7 +191,7 @@ void RollWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
if (note_width_is_fractional && x_is_not_last)
|
||||
++x;
|
||||
x /= m_note_width;
|
||||
return x;
|
||||
return clamp(x, 0, m_num_notes - 1);
|
||||
};
|
||||
|
||||
int x0 = get_note_x(m_note_drag_start.value().x());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue