diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index 328a5cb1f..454d580a7 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -424,19 +424,18 @@ static void lv_obj_draw(lv_event_t * e) info->res = LV_COVER_RES_NOT_COVER; return; } - const lv_grad_dsc_t * grad_dsc = lv_obj_get_style_bg_grad(obj, 0); - if(grad_dsc) { - uint32_t i; - for(i = 0; i < grad_dsc->stops_count; i++) { - if(grad_dsc->stops[i].opa < LV_OPA_MAX) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } + } + const lv_grad_dsc_t * grad_dsc = lv_obj_get_style_bg_grad(obj, 0); + if(grad_dsc) { + uint32_t i; + for(i = 0; i < grad_dsc->stops_count; i++) { + if(grad_dsc->stops[i].opa < LV_OPA_MAX) { + info->res = LV_COVER_RES_NOT_COVER; + return; } } } info->res = LV_COVER_RES_COVER; - } else if(code == LV_EVENT_DRAW_MAIN) { lv_layer_t * layer = lv_event_get_layer(e);