Changeset - r13323:150c888829ca
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-10-22 14:24:11
rubidium@openttd.org
(svn r17842) -Fix: DrawStringMultiLine would in some corner case, top = bottom + 1, draw the string
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -791,6 +791,10 @@ int DrawStringMultiLine(int left, int ri
 
	int maxw = right - left + 1;
 
	int maxh = bottom - top + 1;
 

	
 
	/* It makes no sense to even try if it can't be drawn anyway, or
 
	 * do we really want to support fonts of 0 or less pixels high? */
 
	if (maxh <= 0) return top;
 

	
 
	char buffer[DRAW_STRING_BUFFER];
 
	GetString(buffer, str, lastof(buffer));
 

	
 
@@ -800,7 +804,7 @@ int DrawStringMultiLine(int left, int ri
 
	int mt = GetCharacterHeight((FontSize)GB(tmp, 16, 16));
 
	int total_height = (num + 1) * mt;
 

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

	
0 comments (0 inline, 0 general)