1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

added step easing (#678)

* added snap easing
* moved step function to the bottom of the list

Co-authored-by: Robert <mail@rbeekman.nl>
This commit is contained in:
niko 2022-01-03 06:42:51 -05:00 committed by GitHub
parent ddcb2cfcdb
commit 8b1ce4e0ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,7 @@ namespace Artemis.Core
case Functions.BounceEaseIn: return BounceEaseIn(p);
case Functions.BounceEaseOut: return BounceEaseOut(p);
case Functions.BounceEaseInOut: return BounceEaseInOut(p);
case Functions.Step: return Step (p);
}
}
@ -358,6 +359,13 @@ namespace Artemis.Core
return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5;
}
/// <summary>
/// An snappy animation that moves instantly to the next destination on the next keyframe
/// </summary>
public static double Step (double p) {
return Math.Floor (p);
}
/// <summary>
/// Easing Functions enumeration
/// </summary>
@ -393,7 +401,8 @@ namespace Artemis.Core
BackEaseInOut,
BounceEaseIn,
BounceEaseOut,
BounceEaseInOut
BounceEaseInOut,
Step
}
}
}