Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(disp) be sure the pending scr load animation is finished in lv_sc…
…r_load_anim
  • Loading branch information
kisvegabor committed Sep 7, 2021
1 parent ec9b41a commit eb6ae52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/lv_disp.c
Expand Up @@ -219,16 +219,19 @@ void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa)
*/
void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
{

lv_disp_t * d = lv_obj_get_disp(new_scr);
lv_obj_t * act_scr = lv_scr_act();

if(d->del_prev && act_scr != d->scr_to_load && d->scr_to_load) {
lv_obj_del(act_scr);
if(d->scr_to_load && act_scr != d->scr_to_load) {
lv_disp_load_scr(d->scr_to_load);
lv_anim_del(d->scr_to_load, NULL);
lv_obj_set_pos(d->scr_to_load, 0, 0);
lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0);

if(d->del_prev) {
lv_obj_del(act_scr);
}
act_scr = d->scr_to_load;
}

Expand Down

0 comments on commit eb6ae52

Please sign in to comment.