aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-18 10:13:39 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-18 10:13:39 +0200
commita929901f2dfb135cbb72036b5e49b4fdb38fe24a (patch)
tree6edf7913fd2375dd98e07fe053c9a21d6a4b8322 /src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java
parentd01767620ee480308dfc03185e6a12d7d1e494f3 (diff)
downloadOneConfig-a929901f2dfb135cbb72036b5e49b4fdb38fe24a.tar.gz
OneConfig-a929901f2dfb135cbb72036b5e49b4fdb38fe24a.tar.bz2
OneConfig-a929901f2dfb135cbb72036b5e49b4fdb38fe24a.zip
some stuff
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java
index f43c75d..3855eac 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutQuad.java
@@ -12,12 +12,8 @@ public class EaseInOutQuad extends Animation {
super(duration, start, end, reverse);
}
- /**
- * Adapted from <a href="https://github.com/jesusgollonet/processing-penner-easing">https://github.com/jesusgollonet/processing-penner-easing</a>
- */
@Override
- protected float animate(float timePassed, float duration, float start, float change) {
- if ((timePassed /= duration / 2) < 1) return change / 2 * timePassed * timePassed + start;
- return -change / 2 * ((--timePassed) * (timePassed - 2) - 1) + start;
+ protected float animate(float x) {
+ return x < 0.5 ? 2 * x * x : (float) (1 - Math.pow(-2 * x + 2, 2) / 2);
}
}