Fix #10114: Wonky depot layout. (#10191)

Depot lists internal layout was not handled well. This is improved by
throwing more Rects at it:
- Vehicle images are now be vertically centred in the rect.
- Image clipping is relaxed to cover the rect, improving larger sprites.
- Outline highlight is now aware of bevel thickness.
This commit is contained in:
PeterN
2022-11-23 21:01:09 +00:00
committed by GitHub
parent e85d2603d9
commit 53682b4b6b
8 changed files with 112 additions and 114 deletions

View File

@@ -434,7 +434,7 @@ struct NewGRFInspectWindow : Window {
GrfSpecFeature f = GetFeatureNum(this->window_number);
int h = GetVehicleImageCellSize((VehicleType)(VEH_TRAIN + (f - GSF_TRAINS)), EIT_IN_DEPOT).height;
int y = CenterBounds(br.top, br.bottom, h);
DrawVehicleImage(v->First(), br.left, br.right, y + 1, INVALID_VEHICLE, EIT_IN_DETAILS, skip);
DrawVehicleImage(v->First(), br, INVALID_VEHICLE, EIT_IN_DETAILS, skip);
/* Highlight the articulated part (this is different to the whole-vehicle highlighting of DrawVehicleImage */
if (_current_text_dir == TD_RTL) {