diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java index e30c227..e10679a 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java @@ -1,5 +1,7 @@ package cc.polyfrost.oneconfig.utils; +import cc.polyfrost.oneconfig.gui.OneConfigGui; + public class MathUtils { public static float clamp(float number) { return number < 0f ? 0f : Math.min(number, 1f); @@ -10,8 +12,8 @@ public class MathUtils { } public static float easeOut(float current, float goal, float speed) { - if (Math.round(Math.abs(goal - current) * 25) > 0) { - return current + (goal - current) / speed; + if (Math.round(Math.abs(goal - current) * 100) > 0) { + return current + (goal - current) / speed * (OneConfigGui.INSTANCE == null ? 17 : OneConfigGui.INSTANCE.getDeltaTime()); } else { return goal; } @@ -25,6 +27,7 @@ public class MathUtils { * taken from <a href="https://github.com/jesusgollonet/processing-penner-easing">https://github.com/jesusgollonet/processing-penner-easing</a> */ public static float easeInOutCirc(float t, float b, float c, float d) { + c *= OneConfigGui.INSTANCE == null ? 17 : OneConfigGui.INSTANCE.getDeltaTime(); if ((t /= d / 2) < 1) return -c / 2 * ((float) Math.sqrt(1 - t * t) - 1) + b; return c / 2 * ((float) Math.sqrt(1 - (t -= 2) * t) + 1) + b; } |