mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 00:20:21 +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
Notes:
sideshowbarker
2024-07-18 21:16:15 +09:00
Author: https://github.com/olegv11 Commit: https://github.com/SerenityOS/serenity/commit/9ea15a84acb Pull-request: https://github.com/SerenityOS/serenity/pull/5850 Issue: https://github.com/SerenityOS/serenity/issues/5736
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…
Reference in a new issue