summaryrefslogtreecommitdiff
path: root/src/town_gui.cpp
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2021-05-08 21:01:16 +0100
committerGitHub <noreply@github.com>2021-05-08 21:01:16 +0100
commit330a305c99766b2e62541a8956a00b2cbe7bbbe1 (patch)
tree1f95cc246dcbcd7b93466eec91100594a80dd15e /src/town_gui.cpp
parentb9ab3bd6b3f28b682bf5e155bf35d7cbb8b8224a (diff)
downloadopenttd-330a305c99766b2e62541a8956a00b2cbe7bbbe1.tar.xz
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.
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r--src/town_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 22f8b757f..bd5893561 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -576,7 +576,7 @@ static const NWidgetPart _nested_town_game_view_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
- NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1), SetPadding(1, 1, 1, 1),
+ NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TV_INFO), SetMinimalSize(260, 32), SetResize(1, 0), SetFill(1, 0), EndContainer(),
@@ -606,7 +606,7 @@ static const NWidgetPart _nested_town_editor_view_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
- NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 1), SetResize(1, 1), SetPadding(1, 1, 1, 1),
+ NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_TV_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 1), SetResize(1, 1),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TV_INFO), SetMinimalSize(260, 32), SetResize(1, 0), SetFill(1, 0), EndContainer(),