From 0107879924866ad5547ccfcf1102c154590c7e14 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Mar 2023 08:54:04 +0100 Subject: [PATCH] fix(style): fix layer type caching --- src/core/lv_obj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index d8dfaa605..05be384f1 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -1011,7 +1011,9 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) lv_free(ts); if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_REDRAW) { - lv_obj_invalidate(obj); + // lv_obj_invalidate(obj); + /*Invalidation is not enough, e.g. layer type needs to be updated too*/ + lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); } else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) { lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY);