fix(anim) handle edge cases in lv_anim_path_bounce

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-22 09:48:23 +01:00
parent 700c1290ba
commit b252998b62

View File

@@ -361,13 +361,17 @@ lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t
t = 1024 - t;
diff = diff / 40;
}
else {
else if(t >= 921 && t <= 1024) {
/*Fall back*/
t -= 921;
t = t * 10; /*to [0..1024] range*/
diff = diff / 40;
}
if(t > 1024) t = 1024;
if(t < 0) t = 0;
int32_t step = _lv_bezier3(t, 1024, 800, 500, 0);
int32_t new_value;