Changeset - r12806:a814d916f1c8
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2009-08-29 17:00:32
alberth@openttd.org
(svn r17306) -Fix: DrawStringMultiLine() computed available width and height wrongly.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -748,8 +748,8 @@ int GetStringHeight(StringID str, int ma
 
 */
 
int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, TextColour colour, StringAlignment align, bool underline)
 
{
 
	int maxw = right - left;
 
	int maxh = bottom - top;
 
	int maxw = right - left + 1;
 
	int maxh = bottom - top + 1;
 

	
 
	char buffer[DRAW_STRING_BUFFER];
 
	GetString(buffer, str, lastof(buffer));
 
@@ -760,7 +760,7 @@ int DrawStringMultiLine(int left, int ri
 
	int mt = GetCharacterHeight((FontSize)GB(tmp, 16, 16));
 
	int total_height = (num + 1) * mt;
 

	
 
	if (maxh != -1 && (int)total_height > maxh) {
 
	if (maxh != 0 && total_height > maxh) {
 
		/* Check there's room enough for at least one line. */
 
		if (maxh < mt) return top;
 

	
0 comments (0 inline, 0 general)