summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-22 00:15:00 +0000
committerrubidium <rubidium@openttd.org>2009-03-22 00:15:00 +0000
commita07fae67c371dc8f2d4a89401a0a054d591dd397 (patch)
treeb4b6a477d46761eaf6f881904ac584d19fd5a347 /src/gfx.cpp
parent3abddfe705752ac8477421211f6e664f1a0994fc (diff)
downloadopenttd-a07fae67c371dc8f2d4a89401a0a054d591dd397.tar.xz
(svn r15800) -Codechange: make the engine gui use the new multiline API.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 7398fa018..4fd448b95 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -637,7 +637,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
total_height = (num + 1) * mt;
}
- int y = top;
+ int y = (align == SA_CENTER) ? (bottom + top - num * mt) / 2 : top;
const char *src = buffer;
for (;;) {
@@ -652,7 +652,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
y += mt;
if (--num < 0) {
_cur_fontsize = FS_NORMAL;
- return top + total_height;
+ return y + mt;
}
break;
} else if (c == SCC_SETX) {
@@ -671,7 +671,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
* @param maxw Maximum width the string can have before it is wrapped */
void DrawStringMultiCenter(int x, int y, StringID str, int maxw)
{
- DrawStringMultiLine(x - maxw / 2, x + maxw / 2, y, INT32_MAX, str, SA_CENTER);
+ DrawStringMultiLine(x - maxw / 2, x + maxw / 2, y - 1024, y + 1024, str, SA_CENTER);
}
/** Return the string dimension in pixels. The height and width are returned