From 91e317cd1cadb520e0f87188ca4dbabbb8abbc6d Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 14 Jul 2008 20:18:06 +0000 Subject: (svn r13702) -Fix: do not overflow the order/timetable window when 'long' orders are displayed. --- src/order_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/order_gui.cpp') diff --git a/src/order_gui.cpp b/src/order_gui.cpp index ca28ffb9a..c2ed05d8a 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -162,7 +162,7 @@ extern uint ConvertSpeedToDisplaySpeed(uint speed); extern uint ConvertDisplaySpeedToSpeed(uint speed); -void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable) +void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int y, bool selected, bool timetable, int width) { StringID str = (v->cur_order_index == order_index) ? STR_8805 : STR_8804; SetDParam(6, STR_EMPTY); @@ -257,7 +257,7 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int } SetDParam(0, order_index + 1); - DrawString(2, y, str, selected ? TC_WHITE : TC_BLACK); + DrawStringTruncated(2, y, str, selected ? TC_WHITE : TC_BLACK, width); } @@ -734,7 +734,7 @@ public: /* Don't draw anything if it extends past the end of the window. */ if (i - this->vscroll.pos >= this->vscroll.cap) break; - DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false); + DrawOrderString(this->vehicle, order, i, y, i == this->selected_order, false, this->widget[ORDER_WIDGET_ORDER_LIST].right - 4); y += 10; i++; -- cgit v1.2.3-54-g00ecf