fix(label): dot not add dots if the label height > 1 font line height

fixes: #2907
This commit is contained in:
Gabor Kiss-Vamosi
2021-12-22 17:55:47 +01:00
parent d3b7b4acfd
commit 4d61f38020

View File

@@ -1093,6 +1093,9 @@ static void lv_label_refr_text(lv_obj_t * obj)
if(size.y <= lv_area_get_height(&txt_coords)) { /*No dots are required, the text is short enough*/ if(size.y <= lv_area_get_height(&txt_coords)) { /*No dots are required, the text is short enough*/
label->dot_end = LV_LABEL_DOT_END_INV; label->dot_end = LV_LABEL_DOT_END_INV;
} }
else if(size.y <= lv_font_get_line_height(font)) { /*No dots are required for one-line texts*/
label->dot_end = LV_LABEL_DOT_END_INV;
}
else if(_lv_txt_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/ else if(_lv_txt_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/
label->dot_end = LV_LABEL_DOT_END_INV; label->dot_end = LV_LABEL_DOT_END_INV;
} }