1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

lv_draw_label: letter position bugfix with no anti aliasing

This commit is contained in:
Gabor Kiss-Vamosi 2018-02-09 12:41:48 +01:00
parent bbbf822561
commit f4679bffc3

View File

@ -371,10 +371,13 @@ void lv_draw_label(const lv_area_t * coords,const lv_area_t * mask, const lv_sty
letter_w = lv_font_get_width(font, letter) >> LV_FONT_ANTIALIAS; letter_w = lv_font_get_width(font, letter) >> LV_FONT_ANTIALIAS;
pos.x += letter_w + (style->text.letter_space << LV_AA); pos.x += letter_w + (style->text.letter_space << LV_AA);
#if LV_ANTIALIAS || LV_FONT_ANTIALIAS
/* Round error occurs in x position /* Round error occurs in x position
* When odd widths are scaled down the last 1 is lost. So the letters seems shorter. * When odd widths are scaled down the last 1 is lost. So the letters seems shorter.
* Now calculate according to it to be consequent */ * Now calculate according to it to be consequent */
if(letter_w & 0x01) pos.x--; if(letter_w & 0x01) pos.x--;
#endif
} }
/*Go to next line*/ /*Go to next line*/
line_start = line_end; line_start = line_end;