fix(bar): fix bar only show empty and full when no LV_DRAW_COMPLEX (#9933)
Arduino Lint / lint (push) Has been cancelled
Micropython CI / Build esp32 port (push) Has been cancelled
Micropython CI / Build rp2 port (push) Has been cancelled
Micropython CI / Build stm32 port (push) Has been cancelled
Micropython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT_SWAP (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT (push) Has been cancelled
C/C++ CI / Build OPTIONS_MINIMAL_MONOCHROME (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT (push) Has been cancelled
C/C++ CI / amd64 Executable Tests (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled

This commit is contained in:
Kai
2026-04-13 15:46:04 +08:00
committed by GitHub
parent 790b5d8ecc
commit b0c4cb36b4
+4 -2
View File
@@ -462,6 +462,7 @@ static void draw_indic(lv_event_t * e)
draw_rect_dsc.border_opa = LV_OPA_TRANSP;
draw_rect_dsc.shadow_opa = LV_OPA_TRANSP;
#if LV_DRAW_COMPLEX
/*Get the max possible indicator area. The gradient should be applied on this*/
lv_area_t mask_indic_max_area;
lv_area_copy(&mask_indic_max_area, &bar_coords);
@@ -478,14 +479,15 @@ static void draw_indic(lv_event_t * e)
mask_indic_max_area.x2 = mask_indic_max_area.x1 + LV_BAR_SIZE_MIN;
}
#if LV_DRAW_COMPLEX
/*Create a mask to the current indicator area to see only this part from the whole gradient.*/
lv_draw_mask_radius_param_t mask_indic_param;
lv_draw_mask_radius_init(&mask_indic_param, &bar->indic_area, draw_rect_dsc.radius, false);
int16_t mask_indic_id = lv_draw_mask_add(&mask_indic_param, NULL);
#endif
lv_draw_rect(draw_ctx, &draw_rect_dsc, &mask_indic_max_area);
#else
lv_draw_rect(draw_ctx, &draw_rect_dsc, &bar->indic_area);
#endif
draw_rect_dsc.border_opa = border_opa;
draw_rect_dsc.shadow_opa = shadow_opa;