(svn r13259) -Fix: Subsidy text could still overflow
authorpeter1138
Mon, 26 May 2008 10:28:59 +0000
changeset 9362 ee98b0755c52
parent 9361 7a213ee7ee5b
child 9363 008c7f18f911
(svn r13259) -Fix: Subsidy text could still overflow
src/subsidy_gui.cpp
--- a/src/subsidy_gui.cpp	Mon May 26 05:58:15 2008 +0000
+++ b/src/subsidy_gui.cpp	Mon May 26 10:28:59 2008 +0000
@@ -118,11 +118,14 @@
 
 				/* Displays the two offered towns */
 				SetupSubsidyDecodeParam(s, 1);
-				x2 = DrawStringTruncated(x + 2, y, STR_2027_FROM_TO, TC_FROMSTRING, width);
+				x2 = DrawStringTruncated(x + 2, y, STR_2027_FROM_TO, TC_FROMSTRING, width - 2);
 
-				/* Displays the deadline before voiding the proposal */
-				SetDParam(0, _date - ymd.day + 384 - s->age * 32);
-				DrawStringTruncated(x2, y, STR_2028_BY, TC_FROMSTRING, width - x2);
+				if (width - x2 > 10) {
+					/* Displays the deadline before voiding the proposal */
+					SetDParam(0, _date - ymd.day + 384 - s->age * 32);
+					DrawStringTruncated(x2, y, STR_2028_BY, TC_FROMSTRING, width - x2);
+				}
+
 				y += 10;
 				num++;
 			}