diff --git a/examples/widgets/img/lv_example_img_3.c b/examples/widgets/img/lv_example_img_3.c index 03085d5a2..aa5b5f3b8 100644 --- a/examples/widgets/img/lv_example_img_3.c +++ b/examples/widgets/img/lv_example_img_3.c @@ -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 diff --git a/src/widgets/lv_img.c b/src/widgets/lv_img.c index 126e8805b..b851a8dc1 100644 --- a/src/widgets/lv_img.c +++ b/src/widgets/lv_img.c @@ -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;