Zoom curve

This commit is contained in:
2026-03-26 16:02:29 +01:00
parent 53dfa37b64
commit 3e4985c6bc
2 changed files with 73 additions and 28 deletions
@@ -10,21 +10,22 @@ public abstract class Animation {
public int delay = 0;
public Function<Double, Double> curve = Curve::easeInOutCubic;
public static Function<Double, Double> getCurve(int curve) {
switch (curve) {
case 0:
return Curve::easeInOutCubic;
case 1:
return Curve::easeOutCubic;
case 2:
return Curve::easeInOutBack;
default:
return Curve::easeOutCubic;
}
}
Animation(AnimationConfig config) {
this.duration = config.duration.value;
switch (config.curve.value) {
case 0:
this.curve = Curve::easeInOutCubic;
break;
case 1:
this.curve = Curve::easeOutCubic;
break;
case 2:
this.curve = Curve::easeInOutBack;
break;
default:
break;
}
this.curve = getCurve(config.curve.value);
}
Animation(int duration) {