File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/src/processing/app/tools Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public class MenuScroller {
3434
3535 private JPopupMenu menu ;
3636 private Component [] menuItems ;
37+ private Component [] allMenuItems ;
3738 private MenuScrollItem upItem ;
3839 private MenuScrollItem downItem ;
3940 private final MenuScrollListener menuListener = new MenuScrollListener ();
@@ -540,7 +541,8 @@ public void popupMenuCanceled(PopupMenuEvent e) {
540541 }
541542
542543 private void setMenuItems () {
543- menuItems = Arrays .stream (menu .getComponents ()).filter (x -> x .isVisible ()).toArray (Component []::new );
544+ allMenuItems = menu .getComponents ();
545+ menuItems = Arrays .stream (allMenuItems ).filter (x -> x .isVisible ()).toArray (Component []::new );
544546 if (keepVisibleIndex >= topFixedCount
545547 && keepVisibleIndex <= menuItems .length - bottomFixedCount
546548 && (keepVisibleIndex > firstIndex + scrollCount
@@ -555,7 +557,7 @@ private void setMenuItems() {
555557
556558 private void restoreMenuItems () {
557559 menu .removeAll ();
558- for (Component component : menuItems ) {
560+ for (Component component : allMenuItems ) {
559561 menu .add (component );
560562 }
561563 }
You can’t perform that action at this time.
0 commit comments