summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/Piano/RollWidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/Piano/RollWidget.cpp b/Userland/Applications/Piano/RollWidget.cpp
index 2677fed384..cc63e7ee92 100644
--- a/Userland/Applications/Piano/RollWidget.cpp
+++ b/Userland/Applications/Piano/RollWidget.cpp
@@ -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());