mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r27662) -Codechange: Deduplicate code using GetSingleVehicleWidth.
This commit is contained in:
parent
0d2c341040
commit
88dd4d11b4
@ -2100,9 +2100,7 @@ struct VehicleDetailsWindow : Window {
|
|||||||
case WID_VD_MIDDLE_DETAILS: {
|
case WID_VD_MIDDLE_DETAILS: {
|
||||||
/* For other vehicles, at the place of the matrix. */
|
/* For other vehicles, at the place of the matrix. */
|
||||||
bool rtl = _current_text_dir == TD_RTL;
|
bool rtl = _current_text_dir == TD_RTL;
|
||||||
uint sprite_width = UnScaleGUI(
|
uint sprite_width = GetSingleVehicleWidth(v, EIT_IN_DETAILS) + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
||||||
max<uint>(GetSprite(v->GetImage(rtl ? DIR_E : DIR_W, EIT_IN_DETAILS), ST_NORMAL)->width, 70U)) +
|
|
||||||
WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
|
||||||
|
|
||||||
uint text_left = r.left + (rtl ? 0 : sprite_width);
|
uint text_left = r.left + (rtl ? 0 : sprite_width);
|
||||||
uint text_right = r.right - (rtl ? sprite_width : 0);
|
uint text_right = r.right - (rtl ? sprite_width : 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user