diff options
author | rubidium <rubidium@openttd.org> | 2008-08-12 19:29:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-12 19:29:10 +0000 |
commit | 4ae352d288257aa7566775c1db1f35435cc751d9 (patch) | |
tree | 3b7c8f8994559b39c39079f03127130088a61722 /src/gfx.cpp | |
parent | 4d10054112609301064189f65e0770721e5af5c1 (diff) | |
download | openttd-4ae352d288257aa7566775c1db1f35435cc751d9.tar.xz |
(svn r14054) -Fix (rthebeginning): long strings in the edit box would cause OpenTTD to stop drawing the string. This is especially noticable with low resolutions and the chat input box.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 9f07a60a7..ebedbe6e4 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -770,8 +770,8 @@ void DrawCharCentered(WChar c, int x, int y, uint16 real_color) * While drawing the string, parse it in case some formatting is specified, * like new colour, new size or even positionning. * @param string The string to draw - * @param x Offset from left side of the screen, if negative offset from the right side - * @param y Offset from top side of the screen, if negative offset from the bottom + * @param x Offset from left side of the screen + * @param y Offset from top side of the screen * @param real_colour Colour of the string, see _string_colormap in * table/palettes.h or docs/ottd-colourtext-palette.png or the enum TextColour in gfx_type.h * @param parse_string_also_when_clipped @@ -796,11 +796,7 @@ int DoDrawString(const char *string, int x, int y, uint16 real_colour, bool pars if (!parse_string_also_when_clipped) { /* in "mode multiline", the available space have been verified. Not in regular one. * So if the string cannot be drawn, return the original start to say so.*/ - if (x >= dpi->left + dpi->width || - x + _screen.width * 2 <= dpi->left || - y >= dpi->top + dpi->height || - y + _screen.height <= dpi->top) - return x; + if (x >= dpi->left + dpi->width || y >= dpi->top + dpi->height) return x; if (colour != TC_INVALID) { // the invalid colour flag test should not really occur. But better be safe switch_colour:; |