diff options
author | peter1138 <peter1138@openttd.org> | 2008-05-26 10:28:59 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-05-26 10:28:59 +0000 |
commit | bd5f782c6170a9bd2a32e68134f88e2904b6b284 (patch) | |
tree | eb499b792d6e8b8eb84015cfa79f05c896dfd5c0 /src | |
parent | 690c83edbabec8109f42289a461e653bafbbea7f (diff) | |
download | openttd-bd5f782c6170a9bd2a32e68134f88e2904b6b284.tar.xz |
(svn r13259) -Fix: Subsidy text could still overflow
Diffstat (limited to 'src')
-rw-r--r-- | src/subsidy_gui.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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++; } |