From d11656daf60ef87ed381d65ba4228baac4bde454 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 28 May 2017 17:30:43 +0200 Subject: [PATCH] option menu: exit updateHoverOption() early when mouse is in navigation bar --- src/yugecin/opsudance/ui/OptionsOverlay.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 9f862960..43fdc72e 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -925,8 +925,7 @@ public class OptionsOverlay extends OverlayOpsuState { // active section is the one that is visible in the top half of the screen activeSection = sections[0]; int virtualY = optionStartY; - for (int sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) { - OptionTab section = sections[sectionIndex]; + for (OptionTab section : sections) { if (section.filtered) { continue; } @@ -949,6 +948,10 @@ public class OptionsOverlay extends OverlayOpsuState { } private void updateHoverOption(int mouseX, int mouseY) { + if (mouseX < navWidth) { + hoverOption = null; + return; + } if (openDropdownMenu != null || keyEntryLeft || keyEntryRight) { return; } @@ -977,7 +980,7 @@ public class OptionsOverlay extends OverlayOpsuState { continue; } if (mouseVirtualY <= optionHeight) { - if (mouseX > navWidth && mouseVirtualY >= 0) { + if (mouseVirtualY >= 0) { int indicatorPos = scrollHandler.getIntPosition() + mouseY - mouseVirtualY; if (indicatorPos != this.indicatorPos + indicatorOffsetToNextPos) { this.indicatorPos += indicatorOffsetToNextPos; // finish the current moving animation