fix(vg_lite): use float instead of int to avoid type conversion (#5682)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu
2024-02-19 12:26:48 +08:00
committed by GitHub
parent 46e338e341
commit 907a17c97f

View File

@@ -433,7 +433,7 @@ void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path,
sweep = MATH_RADIANS(sweep);
int n_curves = (int)ceil(MATH_FABSF(sweep / MATH_HALF_PI));
int sweep_sign = (sweep < 0 ? -1 : 1);
float sweep_sign = sweep < 0 ? -1.f : 1.f;
float fract = fmodf(sweep, MATH_HALF_PI);
fract = (math_zero(fract)) ? MATH_HALF_PI * sweep_sign : fract;