From f4679bffc333bf01a47d5a6ce129d40e96601513 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 9 Feb 2018 12:41:48 +0100 Subject: [PATCH] lv_draw_label: letter position bugfix with no anti aliasing --- lv_draw/lv_draw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lv_draw/lv_draw.c b/lv_draw/lv_draw.c index 47b881606..cf6bff10c 100644 --- a/lv_draw/lv_draw.c +++ b/lv_draw/lv_draw.c @@ -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; pos.x += letter_w + (style->text.letter_space << LV_AA); + +#if LV_ANTIALIAS || LV_FONT_ANTIALIAS /* Round error occurs in x position * When odd widths are scaled down the last 1 is lost. So the letters seems shorter. * Now calculate according to it to be consequent */ if(letter_w & 0x01) pos.x--; +#endif } /*Go to next line*/ line_start = line_end;