From 787ad8c5220bb86ced0e256c95ce014c3493fd5f Mon Sep 17 00:00:00 2001 From: yugecin Date: Mon, 27 Aug 2018 21:53:18 +0200 Subject: [PATCH] option overlay should not ignore mouse release event when mouse down event was in bounds --- src/yugecin/opsudance/ui/OptionsOverlay.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index a4e23d92..77e1b643 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -143,6 +143,8 @@ public class OptionsOverlay implements ResolutionChangedListener { private int maxScrollOffset; private int mousePressY; + + private boolean wasPressed; private boolean keyEntryLeft; private boolean keyEntryRight; @@ -796,6 +798,8 @@ public class OptionsOverlay implements ResolutionChangedListener { if (!this.active || x > this.currentWidth) { return false; } + + wasPressed = true; if (keyEntryLeft || keyEntryRight) { keyEntryLeft = keyEntryRight = false; @@ -822,9 +826,11 @@ public class OptionsOverlay implements ResolutionChangedListener { } public boolean mouseReleased(int button, int x, int y) { - if (!this.active || x > this.currentWidth) { + if (!this.active || (!wasPressed && x > this.currentWidth)) { return false; } + + wasPressed = false; selectedOption = null; if (isAdjustingSlider && listener != null) {