Change: Use CenterBounds function in more places.

CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
This commit is contained in:
Peter Nelson
2022-09-07 08:31:02 +01:00
committed by PeterN
parent 18201dfbc3
commit eb4ba1991b
14 changed files with 23 additions and 26 deletions

View File

@@ -437,7 +437,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 = (r.top + r.bottom - h) / 2;
int y = CenterBounds(r.top, r.bottom, h);
DrawVehicleImage(v->First(), r.left + WD_BEVEL_LEFT, r.right - WD_BEVEL_RIGHT, y + 1, INVALID_VEHICLE, EIT_IN_DETAILS, skip);
/* Highlight the articulated part (this is different to the whole-vehicle highlighting of DrawVehicleImage */