Changeset - r24338:0ff72a50c451
[Not reviewed]
master
0 1 0
dP - 4 years ago 2020-08-02 14:26:53
dp@dpointer.org
Fix: sprite preview in sprite aligner is too small with scaled UI
1 file changed with 11 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)