fix(txt): fix returned value of lv_txt_iso8859_1_next(..., NULL) (#3338)
Should return the first character of txt instead of the following one. For example, used in lv_txt_get_width() to get 'letter_next' leading to incorrect lv_font_get_glyph_width results. Co-authored-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
This commit is contained in:
@@ -798,7 +798,7 @@ static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c)
|
||||
*/
|
||||
static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i)
|
||||
{
|
||||
if(i == NULL) return txt[1]; /*Get the next char*/
|
||||
if(i == NULL) return txt[0]; /*Get the next char*/
|
||||
|
||||
uint8_t letter = txt[*i];
|
||||
(*i)++;
|
||||
|
||||
Reference in New Issue
Block a user