Merge pull request #1051 from ahnlak/measure-text-fix

Don't include the spacing after the final letter when measuring bitmap text
pull/1081/head
Philip Howard 2025-05-28 15:17:38 +01:00 zatwierdzone przez GitHub
commit d2c86c22dd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -39,6 +39,12 @@ namespace bitmap {
text_width += letter_spacing * scale;
codepage = unicode_sorta::PAGE_195; // Reset back to default
}
// Do not include the spacing on the final character
if (text_width>0) {
text_width -= letter_spacing * scale;
}
return text_width;
}
@ -230,4 +236,4 @@ namespace bitmap {
i = next_break += 1;
}
}
}
}