option overlay should not ignore mouse release event when mouse down
event was in bounds
This commit is contained in:
@@ -144,6 +144,8 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
|||||||
|
|
||||||
private int mousePressY;
|
private int mousePressY;
|
||||||
|
|
||||||
|
private boolean wasPressed;
|
||||||
|
|
||||||
private boolean keyEntryLeft;
|
private boolean keyEntryLeft;
|
||||||
private boolean keyEntryRight;
|
private boolean keyEntryRight;
|
||||||
|
|
||||||
@@ -797,6 +799,8 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wasPressed = true;
|
||||||
|
|
||||||
if (keyEntryLeft || keyEntryRight) {
|
if (keyEntryLeft || keyEntryRight) {
|
||||||
keyEntryLeft = keyEntryRight = false;
|
keyEntryLeft = keyEntryRight = false;
|
||||||
return true;
|
return true;
|
||||||
@@ -822,10 +826,12 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean mouseReleased(int button, int x, int y) {
|
public boolean mouseReleased(int button, int x, int y) {
|
||||||
if (!this.active || x > this.currentWidth) {
|
if (!this.active || (!wasPressed && x > this.currentWidth)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wasPressed = false;
|
||||||
|
|
||||||
selectedOption = null;
|
selectedOption = null;
|
||||||
if (isAdjustingSlider && listener != null) {
|
if (isAdjustingSlider && listener != null) {
|
||||||
listener.onSaveOption(hoverOption);
|
listener.onSaveOption(hoverOption);
|
||||||
|
|||||||
Reference in New Issue
Block a user