diff --git a/src/itdelatrisu/opsu/ui/KineticScrolling.java b/src/itdelatrisu/opsu/ui/KineticScrolling.java index b373d893..da39c534 100644 --- a/src/itdelatrisu/opsu/ui/KineticScrolling.java +++ b/src/itdelatrisu/opsu/ui/KineticScrolling.java @@ -47,7 +47,7 @@ public class KineticScrolling { private float totalDelta; /** The maximum and minimum value the position can reach. */ - private float max = Float.MAX_VALUE, min = -Float.MAX_VALUE; + public float max = Float.MAX_VALUE, min = -Float.MAX_VALUE; /** Whether the mouse is currently pressed or not. */ private boolean pressed = false; diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index e80e7cc7..f9ee69a4 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -467,7 +467,7 @@ public class DisplayContainer implements ErrorDumpable, ResolutionChangedListene } public boolean isWidescreen() { - return width * 1000 / height == 1777; // 16:9 + return width * 1000 / height > 1500; // 1777 = 16:9, 1333 = 4:3 } @Override diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 55f83871..6d987b8d 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -184,11 +184,12 @@ public class OptionsOverlay extends OverlayOpsuState { public void revalidate() { super.revalidate(); - targetWidth = Math.max((int) (displayContainer.width * 0.36f), 340); // 0.321f + boolean isWidescreen = displayContainer.isWidescreen(); + targetWidth = (int) (displayContainer.width * (isWidescreen ? 0.4f : 0.5f)); height = displayContainer.height; // calculate positions - float navIconWidthRatio = displayContainer.isWidescreen() ? 0.046875f : 0.065f; + float navIconWidthRatio = isWidescreen ? 0.046875f : 0.065f; // non-widescreen ratio is not accurate navButtonSize = (int) (displayContainer.width * navIconWidthRatio); navIndicatorSize = navButtonSize / 10; @@ -869,6 +870,7 @@ public class OptionsOverlay extends OverlayOpsuState { } } } + sectionPosition = Utils.clamp(sectionPosition, (int) scrollHandler.min, (int) scrollHandler.max); scrollHandler.scrollToPosition(sectionPosition); }