(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.
This commit is contained in:
@@ -200,7 +200,7 @@ struct TimetableWindow : Window {
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_VT_ARRIVAL_DEPARTURE_PANEL:
|
||||
SetDParam(0, MAX_YEAR * DAYS_IN_YEAR);
|
||||
SetDParamMaxValue(0, MAX_YEAR * DAYS_IN_YEAR);
|
||||
this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width;
|
||||
this->deparr_abbr_width = max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width);
|
||||
size->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT;
|
||||
@@ -368,7 +368,7 @@ struct TimetableWindow : Window {
|
||||
bool final_order = false;
|
||||
|
||||
bool rtl = _current_text_dir == TD_RTL;
|
||||
SetDParam(0, 99);
|
||||
SetDParamMaxValue(0, v->GetNumOrders(), 2);
|
||||
int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + 3;
|
||||
int middle = rtl ? r.right - WD_FRAMERECT_RIGHT - index_column_width : r.left + WD_FRAMERECT_LEFT + index_column_width;
|
||||
|
||||
|
Reference in New Issue
Block a user