1
0
Fork 0

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

pull/8305/head
dP 2020-08-02 17:26:53 +03:00 committed by Michael Lutz
parent 2693a901f9
commit 3db7cf54fd
1 changed files with 11 additions and 7 deletions

View File

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