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.

(cherry picked from commit 330a305c99)
This commit is contained in:
PeterN
2021-05-08 21:01:16 +01:00
committed by Jonathan G Rennison
parent fe64093cc0
commit d274a81d3f
6 changed files with 20 additions and 8 deletions

View File

@@ -171,7 +171,7 @@ static const NWidgetPart _nested_waypoint_view_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(WWT_INSET, COLOUR_GREY), SetPadding(2, 2, 2, 2),
NWidget(NWID_VIEWPORT, COLOUR_GREY, WID_W_VIEWPORT), SetMinimalSize(256, 88), SetPadding(1, 1, 1, 1), SetResize(1, 1),
NWidget(NWID_VIEWPORT, COLOUR_GREY, WID_W_VIEWPORT), SetMinimalSize(256, 88), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),