Skip to content

Commit d400689

Browse files
authored
fix(draw): fix draw sw subpx font build error (lvgl#4049)
Signed-off-by: FASTSHIFT <[email protected]>
1 parent 0449c40 commit d400689

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/draw/sw/lv_draw_sw_letter.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_
450450
uint8_t font_rgb[3];
451451

452452
lv_color_t color = dsc->color;
453-
uint8_t txt_rgb[3] = {color.ch.red, color.ch.green, color.ch.blue};
453+
uint8_t txt_rgb[3] = {color.red, color.green, color.blue};
454454

455455
lv_draw_sw_blend_dsc_t blend_dsc;
456456
lv_memzero(&blend_dsc, sizeof(blend_dsc));
@@ -489,20 +489,20 @@ static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_
489489
subpx_cnt = 0;
490490

491491
lv_color_t res_color;
492-
uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red, dest_buf_tmp->ch.green, dest_buf_tmp->ch.blue};
492+
uint8_t bg_rgb[3] = {dest_buf_tmp->red, dest_buf_tmp->green, dest_buf_tmp->blue};
493493

494494
#if LV_DRAW_SW_FONT_SUBPX_BGR
495-
res_color.ch.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[2] + (bg_rgb[0] * (255 - font_rgb[2]))) >> 8;
496-
res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[0] + (bg_rgb[2] * (255 - font_rgb[0]))) >> 8;
495+
res_color.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[2] + (bg_rgb[0] * (255 - font_rgb[2]))) >> 8;
496+
res_color.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[0] + (bg_rgb[2] * (255 - font_rgb[0]))) >> 8;
497497
#else
498-
res_color.ch.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8;
499-
res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8;
498+
res_color.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8;
499+
res_color.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8;
500500
#endif
501501

502-
res_color.ch.green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8;
502+
res_color.green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8;
503503

504504
#if LV_COLOR_DEPTH == 32
505-
res_color.ch.alpha = 0xff;
505+
res_color.alpha = 0xff;
506506
#endif
507507

508508
if(font_rgb[0] == 0 && font_rgb[1] == 0 && font_rgb[2] == 0) mask_buf[mask_p] = LV_OPA_TRANSP;

0 commit comments

Comments
 (0)