Skip to content

Commit 3bc9308

Browse files
author
Federico Fissore
committed
MenuScroller: fixed error when scrolling with the mouse wheel but there is nothing to scroll
1 parent 9e81ab6 commit 3bc9308

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/src/processing/app/tools/MenuScroller.java

+4
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ private void refreshMenu() {
441441
firstIndex = Math.max(topFixedCount, firstIndex);
442442
firstIndex = Math.min(menuItems.length - bottomFixedCount - scrollCount, firstIndex);
443443

444+
if (firstIndex < 0) {
445+
return;
446+
}
447+
444448
upItem.setEnabled(firstIndex > topFixedCount);
445449
downItem.setEnabled(firstIndex + scrollCount < menuItems.length - bottomFixedCount);
446450

0 commit comments

Comments
 (0)