1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(img) fix invalidation issue on transformations

fixes #2853
This commit is contained in:
Gabor Kiss-Vamosi 2021-11-30 20:34:57 +01:00
parent cf163b0cc6
commit d5ede0ebc6
2 changed files with 5 additions and 5 deletions

View File

@ -32,15 +32,12 @@ void lv_example_img_3(void)
lv_anim_set_values(&a, 0, 3600);
lv_anim_set_time(&a, 5000);
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
// lv_anim_start(&a);
lv_anim_start(&a);
lv_anim_set_exec_cb(&a, set_zoom);
lv_anim_set_values(&a, 128, 256);
lv_anim_set_playback_time(&a, 3000);
// lv_anim_start(&a);
lv_obj_set_style_blend_mode(img, LV_BLEND_MODE_MULTIPLY, 0);
lv_anim_start(&a);
}
#endif

View File

@ -195,6 +195,7 @@ void lv_img_set_angle(lv_obj_t * obj, int16_t angle)
lv_coord_t transf_angle = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN);
lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
lv_area_t a;
@ -227,6 +228,7 @@ void lv_img_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
lv_coord_t transf_angle = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN);
transf_angle += img->angle;
lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
lv_area_t a;
@ -261,6 +263,7 @@ void lv_img_set_zoom(lv_obj_t * obj, uint16_t zoom)
lv_coord_t transf_angle = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN);
transf_angle += img->angle;
lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
lv_area_t a;