diff options
author | terkhen <terkhen@openttd.org> | 2010-07-11 13:14:08 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-07-11 13:14:08 +0000 |
commit | 0a689a67f56e3c9de907488b0fa881f44123ba99 (patch) | |
tree | df9627a1a888ac84eba9e0da150c2a328e05ac72 | |
parent | 175547b3a525d0451f9211cdcc678054a8d55408 (diff) | |
download | openttd-0a689a67f56e3c9de907488b0fa881f44123ba99.tar.xz |
(svn r20123) -Add [FS#3721]: Use all available space when drawing articulated road vehicles.
-rw-r--r-- | src/vehicle_gui.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 121a6de41..9fe207320 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1635,10 +1635,15 @@ struct VehicleDetailsWindow : Window { uint text_left = r.left + (rtl ? 0 : sprite_width); uint text_right = r.right - (rtl ? sprite_width : 0); - uint sprite_left = rtl ? text_right : r.left; - uint sprite_right = rtl ? r.right : text_left; + /* Articulated road vehicles use a complete line. */ + if (v->type == VEH_ROAD && RoadVehicle::From(v)->HasArticulatedPart()) { + DrawVehicleImage(v, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, INVALID_VEHICLE, 0); + } else { + uint sprite_left = rtl ? text_right : r.left; + uint sprite_right = rtl ? r.right : text_left; - DrawVehicleImage(v, sprite_left + WD_FRAMERECT_LEFT, sprite_right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, INVALID_VEHICLE, 0); + DrawVehicleImage(v, sprite_left + WD_FRAMERECT_LEFT, sprite_right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, INVALID_VEHICLE, 0); + } DrawVehicleDetails(v, text_left + WD_FRAMERECT_LEFT, text_right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, this->vscroll.GetPosition(), this->vscroll.GetCapacity(), this->tab); } break; |