From 9141d95865a84b0d225b3d293d8803e10a414de7 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 24 Feb 2019 07:06:22 +0100 Subject: [PATCH] lv_cont: inform children about parent size change on autofit --- lv_core/lv_obj.c | 3 +-- lv_objx/lv_cont.c | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lv_core/lv_obj.c b/lv_core/lv_obj.c index 16e7433f2..914ef64de 100644 --- a/lv_core/lv_obj.c +++ b/lv_core/lv_obj.c @@ -624,8 +624,7 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) lv_obj_t * par = lv_obj_get_parent(obj); if(par != NULL) par->signal_func(par, LV_SIGNAL_CHILD_CHG, obj); - - /*Tell the children the paren's size has changed*/ + /*Tell the children the parent's size has changed*/ lv_obj_t * i; LL_READ(obj->child_ll, i) { i->signal_func(i, LV_SIGNAL_PARENT_SIZE_CHG, NULL); diff --git a/lv_objx/lv_cont.c b/lv_objx/lv_cont.c index 41255b789..f45a9cb01 100644 --- a/lv_objx/lv_cont.c +++ b/lv_objx/lv_cont.c @@ -710,6 +710,12 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) /*Inform the parent about the new coordinates*/ lv_obj_t * par = lv_obj_get_parent(cont); par->signal_func(par, LV_SIGNAL_CHILD_CHG, cont); + + /*Tell the children the parent's size has changed*/ + lv_obj_t * i; + LL_READ(cont->child_ll, i) { + i->signal_func(i, LV_SIGNAL_PARENT_SIZE_CHG, NULL); + } } }