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

fix(obj): old parent's scroll is not updated in lv_obj_set_parent() (#2965)

This commit is contained in:
guoweilkd 2022-01-07 04:56:53 +08:00 committed by GitHub
parent 6b841555cd
commit e00b51b04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,6 +172,8 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
obj->parent = parent; obj->parent = parent;
/*Notify the original parent because one of its children is lost*/ /*Notify the original parent because one of its children is lost*/
lv_obj_readjust_scroll(old_parent, LV_ANIM_OFF);
lv_obj_scrollbar_invalidate(old_parent);
lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj); lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj);
lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL); lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL);