src/gfx.cpp
branchnoai
changeset 9566 9936b201d53f
parent 9545 179f651eb116
child 6719 4cc327ad39d5
child 6974 24490c839582
child 9601 b499fdd106d5
--- a/src/gfx.cpp	Tue Mar 27 13:47:20 2007 +0000
+++ b/src/gfx.cpp	Tue Mar 27 13:58:24 2007 +0000
@@ -548,10 +548,11 @@
 	mt = GetCharacterHeight((FontSize)GB(tmp, 16, 16));
 	total_height = (num + 1) * mt;
 
-	if (maxh != -1 && total_height > (uint)maxh) {
+	if (maxh != -1 && (int)total_height > maxh) {
+		/* Check there's room enough for at least one line. */
+		if (maxh < mt) return 0;
+
 		num = maxh / mt - 1;
-		if (num < 1) return 0;
-
 		total_height = (num + 1) * mt;
 	}