center town labels on minimap

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2015-03-20 20:27:38 +03:00
parent d0b474b3e4
commit 58b4d9fc46
3 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -1310,7 +1310,7 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
* @param top the new top of the sign
* @param str the string to show in the sign
*/
void ViewportSign::UpdatePosition(int center, int top, StringID str)
void ViewportSign::UpdatePosition(int center, int top, StringID str, StringID small_str)
{
if (this->width_normal != 0) this->MarkDirty();
@@ -1323,6 +1323,9 @@ void ViewportSign::UpdatePosition(int center, int top, StringID str)
this->center = center;
/* zoomed out version */
if (small_str != STR_NULL) {
GetString(buffer, small_str, lastof(buffer));
}
this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + VPSM_RIGHT;
this->MarkDirty();