Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(obj) fix size invalidation issue on padding change
If a style properties with LV_STYLE_PROP_LAYOUT_REFR is applied
on a not MAIN part it might effect the size if the size is LV_SIZE_CONTENT.
So check it in lv_obj_refresh_style()
  • Loading branch information
kisvegabor committed Jul 16, 2021
1 parent 1c3ecf1 commit 33ba722
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/lv_obj_style.c
Expand Up @@ -175,9 +175,15 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style

lv_part_t part = lv_obj_style_get_selector_part(selector);

if((part == LV_PART_ANY || part == LV_PART_MAIN) && (prop == LV_STYLE_PROP_ANY || (prop & LV_STYLE_PROP_LAYOUT_REFR))) {
lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL);
lv_obj_mark_layout_as_dirty(obj);
if(prop & LV_STYLE_PROP_LAYOUT_REFR) {
if(part == LV_PART_ANY ||
part == LV_PART_MAIN ||
lv_obj_get_style_height(obj, 0) == LV_SIZE_CONTENT ||
lv_obj_get_style_width(obj, 0) == LV_SIZE_CONTENT)
{
lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL);
lv_obj_mark_layout_as_dirty(obj);
}
}
if((part == LV_PART_ANY || part == LV_PART_MAIN) && (prop == LV_STYLE_PROP_ANY || (prop & LV_STYLE_PROP_PARENT_LAYOUT_REFR))) {
lv_obj_t * parent = lv_obj_get_parent(obj);
Expand Down

0 comments on commit 33ba722

Please sign in to comment.