1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(img): support negative angles (#3846)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu 2022-12-06 14:54:41 +08:00 committed by GitHub
parent be27e3ca6f
commit 32948428c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,7 +186,8 @@ void lv_img_set_offset_y(lv_obj_t * obj, lv_coord_t y)
void lv_img_set_angle(lv_obj_t * obj, int16_t angle)
{
if(angle < 0 || angle >= 3600) angle = angle % 3600;
while(angle >= 3600) angle -= 3600;
while(angle < 0) angle += 3600;
lv_img_t * img = (lv_img_t *)obj;
if(angle == img->angle) return;