From feebf3f3c9880eb3c2f57fd96b8a13a4c6a8eb66 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 26 May 2008 10:28:59 +0000 Subject: (svn r13259) -Fix: Subsidy text could still overflow --- src/subsidy_gui.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index ca81c0271..d8b39dbc2 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -118,11 +118,14 @@ struct SubsidyListWindow : Window { /* 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); + + 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); + } - /* 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++; } -- cgit v1.2.3-70-g09d2