- fixed the status bar string drawers which weren't UTF-8 capable yet.
This commit is contained in:
parent
c5156d4598
commit
bae0094039
2 changed files with 15 additions and 18 deletions
|
|
@ -1481,15 +1481,15 @@ void DBaseStatusBar::DrawString(FFont *font, const FString &cstring, double x, d
|
|||
break;
|
||||
case DI_TEXT_ALIGN_RIGHT:
|
||||
if (!monospaced)
|
||||
x -= static_cast<int> (font->StringWidth(cstring) + (spacing * cstring.Len()));
|
||||
x -= static_cast<int> (font->StringWidth(cstring) + (spacing * cstring.CharacterCount()));
|
||||
else //monospaced, so just multiply the character size
|
||||
x -= static_cast<int> ((spacing) * cstring.Len());
|
||||
x -= static_cast<int> ((spacing) * cstring.CharacterCount());
|
||||
break;
|
||||
case DI_TEXT_ALIGN_CENTER:
|
||||
if (!monospaced)
|
||||
x -= static_cast<int> (font->StringWidth(cstring) + (spacing * cstring.Len())) / 2;
|
||||
x -= static_cast<int> (font->StringWidth(cstring) + (spacing * cstring.CharacterCount())) / 2;
|
||||
else //monospaced, so just multiply the character size
|
||||
x -= static_cast<int> ((spacing)* cstring.Len()) / 2;
|
||||
x -= static_cast<int> ((spacing)* cstring.CharacterCount()) / 2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1527,7 +1527,7 @@ void DBaseStatusBar::DrawString(FFont *font, const FString &cstring, double x, d
|
|||
Scale = { 1.,1. };
|
||||
}
|
||||
int ch;
|
||||
while (ch = *str++, ch != '\0')
|
||||
while (ch = GetCharFromString(str), ch != '\0')
|
||||
{
|
||||
if (ch == ' ')
|
||||
{
|
||||
|
|
@ -1543,7 +1543,7 @@ void DBaseStatusBar::DrawString(FFont *font, const FString &cstring, double x, d
|
|||
}
|
||||
|
||||
int width;
|
||||
FTexture* c = font->GetChar((unsigned char)ch, fontcolor, &width);
|
||||
FTexture* c = font->GetChar(ch, fontcolor, &width);
|
||||
if (c == NULL) //missing character.
|
||||
{
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue