Skip to content

Commit

Permalink
fix(scrollbar) hide the scrollbar if the scrollble flag is removed
Browse files Browse the repository at this point in the history
kisvegabor committed Sep 30, 2021
1 parent 188a946 commit d9c6ad0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/lv_obj.c
Original file line number Diff line number Diff line change
@@ -226,7 +226,6 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
LV_ASSERT_OBJ(obj, MY_CLASS);

bool was_on_layout = lv_obj_is_layout_positioned(obj);
bool scrollable_chg = (f & LV_OBJ_FLAG_SCROLLABLE) != (obj->flags & LV_OBJ_FLAG_SCROLLABLE);

if(f & LV_OBJ_FLAG_HIDDEN) lv_obj_invalidate(obj);

@@ -240,7 +239,7 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
}

if(scrollable_chg) {
if(f & LV_OBJ_FLAG_SCROLLABLE) {
lv_area_t hor_area, ver_area;
lv_obj_get_scrollbar_area(obj, &hor_area, &ver_area);
lv_obj_invalidate_area(obj, &hor_area);
@@ -253,8 +252,7 @@ void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f)
LV_ASSERT_OBJ(obj, MY_CLASS);

bool was_on_layout = lv_obj_is_layout_positioned(obj);
bool scrollable_chg = (f & LV_OBJ_FLAG_SCROLLABLE) != (obj->flags & LV_OBJ_FLAG_SCROLLABLE);
if(scrollable_chg) {
if(f & LV_OBJ_FLAG_SCROLLABLE) {
lv_area_t hor_area, ver_area;
lv_obj_get_scrollbar_area(obj, &hor_area, &ver_area);
lv_obj_invalidate_area(obj, &hor_area);

0 comments on commit d9c6ad0

Please sign in to comment.