Fix: sprite preview in sprite aligner is too small with scaled UI

This commit is contained in:
dP
2020-08-02 17:38:21 +03:00
parent 9e71376cf1
commit 142751fe17
2 changed files with 13 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ This is usable for any OpenTTD servers
== CHANGELOG ==
*** next () ***
*** 1.10.3 () ***
- Fix order hotkeys adding extra no load/unload orders.
- Allow to use TAB as a hotkey.
- Add hotkey to toggle minimap.
@@ -93,6 +93,7 @@ This is usable for any OpenTTD servers
- Add APM counter to the status bar.
- Fix town HR couter.
- Allow spectators to open industry funding window from the menu.
- Fix graphical glitches after switching to location with hotkey.
*** 1.10.2 (5 Jun 2020) ***
- Add new minimap mode showing industries, height and farms at the same time.

View File

@@ -859,13 +859,17 @@ struct SpriteAlignerWindow : Window {
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget != WID_SA_LIST) return;
resize->height = max(11, FONT_HEIGHT_NORMAL + 1);
resize->width = 1;
/* Resize to about 200 pixels (for the preview) */
size->height = (1 + 200 / resize->height) * resize->height;
switch (widget) {
case WID_SA_SPRITE:
size->height = ScaleGUITrad(200);
break;
case WID_SA_LIST:
resize->height = max(11, FONT_HEIGHT_NORMAL + 1);
resize->width = 1;
break;
default:
break;
}
}
void DrawWidget(const Rect &r, int widget) const override