Change: Use power-of-2 scaling for some dimensions in GUI.
These are related to drawing sprites that are normally drawn on the landscape, and should therefore still follow power-of-2 scaling to fit correctly.
This commit is contained in:
@@ -986,8 +986,8 @@ struct BuildRoadDepotWindow : public PickerWindowBase {
|
||||
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
||||
DrawPixelInfo *old_dpi = _cur_dpi;
|
||||
_cur_dpi = &tmp_dpi;
|
||||
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
||||
int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31);
|
||||
int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31);
|
||||
int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31);
|
||||
DrawRoadDepotSprite(x, y, (DiagDirection)(widget - WID_BROD_DEPOT_NE + DIAGDIR_NE), _cur_roadtype);
|
||||
_cur_dpi = old_dpi;
|
||||
}
|
||||
@@ -1121,8 +1121,8 @@ struct BuildRoadStationWindow : public PickerWindowBase {
|
||||
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
||||
DrawPixelInfo *old_dpi = _cur_dpi;
|
||||
_cur_dpi = &tmp_dpi;
|
||||
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
||||
int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31);
|
||||
int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31);
|
||||
int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31);
|
||||
StationPickerDrawSprite(x, y, st, INVALID_RAILTYPE, _cur_roadtype, widget - WID_BROS_STATION_NE);
|
||||
_cur_dpi = old_dpi;
|
||||
}
|
||||
|
Reference in New Issue
Block a user