fix(style): be sure to not add a style with the same selector twice

fixes #4133
This commit is contained in:
Gabor Kiss-Vamosi
2023-04-17 12:52:26 +02:00
parent 1fed654577
commit d34958f588
+3
View File
@@ -81,6 +81,9 @@ void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selecto
trans_del(obj, selector, LV_STYLE_PROP_ANY, NULL);
/*Try removing the style first to be sure it won't be added twice*/
lv_obj_remove_style(obj, style, selector);
uint32_t i;
/*Go after the transition and local styles*/
for(i = 0; i < obj->style_cnt; i++) {