mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 07:06:19 +08:00
fix(flex): fix crash with flex_grow on screen (#9090)
This commit is contained in:
committed by
GitHub
parent
938fd8a7d8
commit
d5b93842a2
@@ -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)
|
void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow)
|
||||||
{
|
{
|
||||||
lv_obj_set_style_flex_grow(obj, grow, 0);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -191,4 +191,11 @@ void test_flex_use_rtl(void)
|
|||||||
TEST_ASSERT_EQUAL_SCREENSHOT("flex_use_rtl.png");
|
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
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user