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:
parent
be27e3ca6f
commit
32948428c3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user