fix(flex): fix crash with flex_grow on screen (#9090)

This commit is contained in:
Gabor Kiss-Vamosi
2025-10-20 17:10:54 +02:00
committed by GitHub
parent 938fd8a7d8
commit d5b93842a2
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -116,7 +116,8 @@ void lv_obj_set_flex_align(lv_obj_t * obj, lv_flex_align_t main_place, lv_flex_a
void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow)
{
lv_obj_set_style_flex_grow(obj, grow, 0);
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
lv_obj_t * parent = lv_obj_get_parent(obj);
if(parent) lv_obj_mark_layout_as_dirty(parent);
}
/**********************
+7
View File
@@ -191,4 +191,11 @@ void test_flex_use_rtl(void)
TEST_ASSERT_EQUAL_SCREENSHOT("flex_use_rtl.png");
}
void test_flex_grow_on_screen_should_not_crash(void)
{
lv_obj_set_flex_grow(lv_screen_active(), 1);
lv_refr_now(NULL);
}
#endif