From 65f95696eb9be915ee92b70cee2161668d7b2771 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 28 May 2017 16:15:11 +0200 Subject: [PATCH] fix option menu hover update stuff when scrolling is happening --- src/yugecin/opsudance/ui/OptionsOverlay.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 87c8914e..c7760d14 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -606,7 +606,9 @@ public class OptionsOverlay extends OverlayOpsuState { int mouseY = displayContainer.mouseY; int delta = displayContainer.renderDelta; + int prevscrollpos = scrollHandler.getIntPosition(); scrollHandler.update(delta); + boolean scrollPositionChanged = prevscrollpos != scrollHandler.getIntPosition(); if (openDropdownMenu == null) { for (DropdownMenu menu : visibleDropdownMenus) { @@ -634,7 +636,7 @@ public class OptionsOverlay extends OverlayOpsuState { navHoverTime -= delta; } - if (mouseX - prevMouseX == 0 && mouseY - prevMouseY == 0) { + if (!scrollPositionChanged && (mouseX - prevMouseX == 0 && mouseY - prevMouseY == 0)) { updateIndicatorAlpha(); return; } @@ -855,7 +857,6 @@ public class OptionsOverlay extends OverlayOpsuState { if (!isAdjustingSlider) { scrollHandler.scrollOffset(-delta); } - updateHoverOption(prevMouseX, prevMouseY); return true; }