common_tasks: fix common_easing_animate
Make it actually arrive at the target value
This commit is contained in:
parent
2e5000299f
commit
c1f36bf0a5
1 changed files with 6 additions and 6 deletions
|
@ -315,13 +315,13 @@ cmplx common_wander(cmplx origin, double dist, Rect bounds) {
|
|||
}
|
||||
|
||||
DEFINE_EXTERN_TASK(common_easing_animate) {
|
||||
float from = *ARGS.value;
|
||||
float scale = ARGS.to - from;
|
||||
float ftime = ARGS.duration;
|
||||
float from = *ARGS.value;
|
||||
float scale = ARGS.to - from;
|
||||
float ftime = ARGS.duration;
|
||||
|
||||
for(int t = 0; t < ARGS.duration;t++) {
|
||||
YIELD;
|
||||
*ARGS.value = from + scale * ARGS.ease(t / ftime);
|
||||
for(int t = 1; t <= ARGS.duration; t++) {
|
||||
YIELD;
|
||||
*ARGS.value = from + scale * ARGS.ease(t / ftime);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue