(svn r18575) -Fix [FS#3393]: unit numbers weren't always fully shown in the depot
This commit is contained in:
14
src/gfx.cpp
14
src/gfx.cpp
@@ -1306,6 +1306,20 @@ byte GetCharacterWidth(FontSize size, WChar key)
|
||||
return GetGlyphWidth(size, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the maximum width of single digit.
|
||||
* @param size Font of the digit
|
||||
* @return Width of the digit.
|
||||
*/
|
||||
byte GetDigitWidth(FontSize size)
|
||||
{
|
||||
byte width = 0;
|
||||
for (char c = '0'; c <= '9'; c++) {
|
||||
width = max(GetCharacterWidth(size, c), width);
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
void ScreenSizeChanged()
|
||||
{
|
||||
|
Reference in New Issue
Block a user