From 330a305c99766b2e62541a8956a00b2cbe7bbbe1 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 8 May 2021 21:01:16 +0100 Subject: Fix: Apply unscaled padding to Viewport inside WWT_INSET. (#9219) Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive. Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT. --- src/news_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/news_gui.cpp') diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 8d0531682..d3ddd463f 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -192,7 +192,7 @@ static const NWidgetPart _nested_small_news_widgets[] = { /* Main part */ NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_N_HEADLINE), NWidget(WWT_INSET, COLOUR_LIGHT_BLUE, WID_N_INSET), SetPadding(2, 2, 2, 2), - NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_N_VIEWPORT), SetPadding(1, 1, 1, 1), SetMinimalSize(274, 47), SetFill(1, 0), + NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_N_VIEWPORT), SetMinimalSize(274, 47), SetFill(1, 0), EndContainer(), NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(275, 20), SetFill(1, 0), SetPadding(0, 5, 0, 5), EndContainer(), -- cgit v1.2.3-54-g00ecf