mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
lv_txt_get_width: trim the last letter space
This commit is contained in:
parent
5fedbdf414
commit
6a610949e9
@ -199,6 +199,8 @@ lv_coord_t lv_txt_get_width(const char * txt, uint16_t length,
|
||||
width += letter_space;
|
||||
}
|
||||
|
||||
width -= letter_space; /*Trim the last letter space because there is no letter after it*/
|
||||
|
||||
/*Trim closing spaces. Important when the text is aligned to the middle */
|
||||
for(i = length - 1; i > 0; i--) {
|
||||
if(txt[i] == ' ') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user