diff options
author | peter1138 <peter1138@openttd.org> | 2014-10-04 16:40:23 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2014-10-04 16:40:23 +0000 |
commit | ce9fab58bc02cda3fde8d3cb42fd88f25889b340 (patch) | |
tree | 7b92188f2ac8622c17ee45cd6c54bd16196c064c /src/vehicle_gui.cpp | |
parent | 587ad940cc46ffb573e080320bac51085994b7f7 (diff) | |
download | openttd-ce9fab58bc02cda3fde8d3cb42fd88f25889b340.tar.xz |
(svn r26951) -Codechange: Do the GUI-scale dance for vehicle, depot, and purchase lists.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 16813cea5..3d122ff6a 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -655,7 +655,7 @@ struct RefitWindow : public Window { break; case WID_VR_VEHICLE_PANEL_DISPLAY: - size->height = GetVehicleHeight(Vehicle::Get(this->window_number)->type); + size->height = UnScaleByZoom(4 * GetVehicleHeight(Vehicle::Get(this->window_number)->type), ZOOM_LVL_GUI); break; case WID_VR_INFO: @@ -752,7 +752,7 @@ struct RefitWindow : public Window { } if (left != right) { - DrawFrameRect(left, r.top + WD_FRAMERECT_TOP, right, r.top + WD_FRAMERECT_TOP + 13, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect(left, r.top + WD_FRAMERECT_TOP, right, r.top + WD_FRAMERECT_TOP + UnScaleByZoom(4 * 14, ZOOM_LVL_GUI) - 1, COLOUR_WHITE, FR_BORDERONLY); } left = INT32_MIN; @@ -1330,7 +1330,7 @@ void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID se uint GetVehicleListHeight(VehicleType type, uint divisor) { /* Name + vehicle + profit */ - uint base = GetVehicleHeight(type) + 2 * FONT_HEIGHT_SMALL; + uint base = UnScaleByZoom(4 * GetVehicleHeight(type), ZOOM_LVL_GUI) + 2 * FONT_HEIGHT_SMALL; /* Drawing of the 4 small orders + profit*/ if (type >= VEH_SHIP) base = max(base, 5U * FONT_HEIGHT_SMALL); @@ -1354,13 +1354,13 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int int width = right - left; bool rtl = _current_text_dir == TD_RTL; - int text_offset = GetDigitWidth() * this->unitnumber_digits + WD_FRAMERECT_RIGHT; + int text_offset = max<int>(GetSpriteSize(SPR_PROFIT_LOT).width, GetDigitWidth() * this->unitnumber_digits) + WD_FRAMERECT_RIGHT; int text_left = left + (rtl ? 0 : text_offset); int text_right = right - (rtl ? text_offset : 0); bool show_orderlist = this->vli.vtype >= VEH_SHIP; - int orderlist_left = left + (rtl ? 0 : max(100 + text_offset, width / 2)); - int orderlist_right = right - (rtl ? max(100 + text_offset, width / 2) : 0); + int orderlist_left = left + (rtl ? 0 : max(UnScaleByZoom(4 * 100, ZOOM_LVL_GUI) + text_offset, width / 2)); + int orderlist_right = right - (rtl ? max(UnScaleByZoom(4 * 100, ZOOM_LVL_GUI) + text_offset, width / 2) : 0); int image_left = (rtl && show_orderlist) ? orderlist_right : text_left; int image_right = (!rtl && show_orderlist) ? orderlist_left : text_right; @@ -1896,7 +1896,7 @@ struct VehicleDetailsWindow : Window { uint desired_height; if (v->HasArticulatedPart()) { /* An articulated RV has its text drawn under the sprite instead of after it, hence 15 pixels extra. */ - desired_height = WD_FRAMERECT_TOP + 15 + 3 * FONT_HEIGHT_NORMAL + 2 + WD_FRAMERECT_BOTTOM; + desired_height = WD_FRAMERECT_TOP + UnScaleByZoom(4 * 15, ZOOM_LVL_GUI) + 3 * FONT_HEIGHT_NORMAL + 2 + WD_FRAMERECT_BOTTOM; /* Add space for the cargo amount for each part. */ for (const Vehicle *u = v; u != NULL; u = u->Next()) { if (u->cargo_cap != 0) desired_height += FONT_HEIGHT_NORMAL + 1; @@ -1953,7 +1953,7 @@ struct VehicleDetailsWindow : Window { } case WID_VD_MATRIX: - resize->height = WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM; + resize->height = max(UnScaleByZoom(4 * 14, ZOOM_LVL_GUI), WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM); size->height = 4 * resize->height; break; |