Merge branch 'master' into jgrpp
# Conflicts: # src/core/geometry_type.hpp # src/error_gui.cpp # src/rail_gui.cpp # src/tree_gui.cpp # src/vehicle_gui.cpp # src/widgets/dropdown.cpp
This commit is contained in:
@@ -474,7 +474,7 @@ struct NewGRFInspectWindow : Window {
|
||||
if (u == v) sel_end = total_width;
|
||||
}
|
||||
|
||||
int width = r.right + 1 - r.left - WD_BEVEL_LEFT - WD_BEVEL_RIGHT;
|
||||
int width = r.Width() - WD_BEVEL_LEFT - WD_BEVEL_RIGHT;
|
||||
int skip = 0;
|
||||
if (total_width > width) {
|
||||
int sel_center = (sel_start + sel_end) / 2;
|
||||
@@ -483,7 +483,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 */
|
||||
@@ -1301,8 +1301,8 @@ struct SpriteAlignerWindow : Window {
|
||||
case WID_SA_SPRITE: {
|
||||
/* Center the sprite ourselves */
|
||||
const Sprite *spr = GetSprite(this->current_sprite, ST_NORMAL);
|
||||
int width = r.right - r.left + 1 - WD_BEVEL_LEFT - WD_BEVEL_RIGHT;
|
||||
int height = r.bottom - r.top + 1 - WD_BEVEL_TOP - WD_BEVEL_BOTTOM;
|
||||
int width = r.Width() - WD_BEVEL_LEFT - WD_BEVEL_RIGHT;
|
||||
int height = r.Height() - WD_BEVEL_TOP - WD_BEVEL_BOTTOM;
|
||||
int x = -UnScaleGUI(spr->x_offs) + (width - UnScaleGUI(spr->width) ) / 2;
|
||||
int y = -UnScaleGUI(spr->y_offs) + (height - UnScaleGUI(spr->height)) / 2;
|
||||
|
||||
|
Reference in New Issue
Block a user