summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 4fd448b95..be008c1c0 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 = (align == SA_CENTER) ? (bottom + top - num * mt) / 2 : top;
+ int y = (align == SA_CENTER) ? (bottom + top - total_height + 1) / 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 y + mt;
+ return y;
}
break;
} else if (c == SCC_SETX) {
@@ -664,16 +664,6 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
}
}
-/** Draw a given string with the centre around the given (x,y) coordinates
- * @param x Centre the string around this pixel width
- * @param y Centre the string around this pixel height
- * @param str String to draw
- * @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 - 1024, y + 1024, str, SA_CENTER);
-}
-
/** Return the string dimension in pixels. The height and width are returned
* in a single Dimension value. TINYFONT, BIGFONT modifiers are only
* supported as the first character of the string. The returned dimensions