1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

MenuScroller: fixed error when scrolling with the mouse wheel but there is nothing to scroll

This commit is contained in:
Federico Fissore 2015-06-22 14:30:21 +02:00
parent 9e81ab67bb
commit 3bc9308abc

View File

@ -441,6 +441,10 @@ public class MenuScroller {
firstIndex = Math.max(topFixedCount, firstIndex);
firstIndex = Math.min(menuItems.length - bottomFixedCount - scrollCount, firstIndex);
if (firstIndex < 0) {
return;
}
upItem.setEnabled(firstIndex > topFixedCount);
downItem.setEnabled(firstIndex + scrollCount < menuItems.length - bottomFixedCount);