Label: Fix kerning when using Uppercase mode

Seemingly a typo, I did not check what exact impact it had, but
the x_ofs would likely have accumulated errors when using fonts
with varying char widths.

(cherry picked from commit 7cb5e005ee)
This commit is contained in:
Rémi Verschelde 2018-12-17 20:55:45 +01:00
parent 69673367a1
commit 49d724ac52
1 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,7 @@ void Label::_notification(int p_what) {
CharType n = xl_text[i + pos + 1];
if (uppercase) {
c = String::char_uppercase(c);
n = String::char_uppercase(c);
n = String::char_uppercase(n);
}
float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + shadow_ofs, c, n, font_color_shadow);
@ -262,7 +262,7 @@ void Label::_notification(int p_what) {
CharType n = xl_text[i + pos + 1];
if (uppercase) {
c = String::char_uppercase(c);
n = String::char_uppercase(c);
n = String::char_uppercase(n);
}
x_ofs += font->draw_char(ci, Point2(x_ofs, y_ofs), c, n, font_color);