summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-10-16 14:56:05 +0000
committerfrosch <frosch@openttd.org>2016-10-16 14:56:05 +0000
commit88dd4d11b41a2fe2f1097e695232ed71e669de90 (patch)
tree39b080060ba4d1cb976ab7b96059f63970bcbc73
parent0d2c341040cc1174ad9933f911df64a7947914de (diff)
downloadopenttd-88dd4d11b41a2fe2f1097e695232ed71e669de90.tar.xz
(svn r27662) -Codechange: Deduplicate code using GetSingleVehicleWidth.
-rw-r--r--src/vehicle_gui.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index a5ff3f353..021c56294 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -2100,9 +2100,7 @@ struct VehicleDetailsWindow : Window {
case WID_VD_MIDDLE_DETAILS: {
/* For other vehicles, at the place of the matrix. */
bool rtl = _current_text_dir == TD_RTL;
- uint sprite_width = UnScaleGUI(
- max<uint>(GetSprite(v->GetImage(rtl ? DIR_E : DIR_W, EIT_IN_DETAILS), ST_NORMAL)->width, 70U)) +
- WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
+ uint sprite_width = GetSingleVehicleWidth(v, EIT_IN_DETAILS) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
uint text_left = r.left + (rtl ? 0 : sprite_width);
uint text_right = r.right - (rtl ? sprite_width : 0);