mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
Fix: sprite preview in sprite aligner is too small with scaled UI
This commit is contained in:
parent
2693a901f9
commit
3db7cf54fd
@ -856,13 +856,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
|
||||
|
Loading…
Reference in New Issue
Block a user