From 9e34000dfc0d5d93a1e930cfb77f6dfa056dc114 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 14 Jun 2019 15:15:20 +0200 Subject: [PATCH] label hint updates --- src/lv_draw/lv_draw_label.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lv_draw/lv_draw_label.c b/src/lv_draw/lv_draw_label.c index 80cbef74e..55a2b1538 100644 --- a/src/lv_draw/lv_draw_label.c +++ b/src/lv_draw/lv_draw_label.c @@ -88,7 +88,10 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st uint32_t line_start = 0; int32_t last_line_start = -1; if(hint) { - if(hint->coord_y == coords->y1) last_line_start = hint->line_start; + if(LV_MATH_ABS(hint->coord_y - coords->y1) > 800) { + hint->line_start = -1; + last_line_start = hint->line_start; + } } if(last_line_start >= 0) { line_start = last_line_start; @@ -105,7 +108,8 @@ void lv_draw_label(const lv_area_t * coords, const lv_area_t * mask, const lv_st line_end += lv_txt_get_next_line(&txt[line_start], font, style->text.letter_space, w, flag); pos.y += line_height; - if(pos.y + line_height <= 0 && pos.y + 2 * line_height > 0 && hint_saved == false) { +// if(pos.y + line_height <= 0 && pos.y + 2 * line_height > 0 && hint_saved == false) { + if(pos.y >= -1000 && hint->line_start < 0) { hint->line_start = line_start; hint->y = pos.y; hint->coord_y = coords->y1;