aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorVincent Robinson <robinsonvincent89@gmail.com>2021-01-23 14:49:13 -0800
committerGitHub <noreply@github.com>2021-01-23 14:49:13 -0800
commitad9adcb88444b4a7063d5c2f5debd85729e8ce42 (patch)
tree72f91e5e00c2a5fff1016a32a262df85594e913b /src/gui
parent6a55c03dabf7b5337233fc80078a300d485fcec4 (diff)
downloadminetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.tar.gz
minetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.tar.bz2
minetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.zip
Fix formspec list spacing (#10861)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiFormSpecMenu.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 7b37de6f8..e4678bcd1 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -507,10 +507,13 @@ void GUIFormSpecMenu::parseList(parserData *data, const std::string &element)
v2f32 slot_spacing = style.getVector2f(StyleSpec::SPACING, v2f32(-1, -1));
if (data->real_coordinates) {
- slot_spacing.X = slot_spacing.X < 0 ? imgsize.X * 1.25f :
- slot_spacing.X * imgsize.X + imgsize.X;
- slot_spacing.Y = slot_spacing.Y < 0 ? imgsize.Y * 1.25f :
- slot_spacing.Y * imgsize.Y + imgsize.Y;
+ slot_spacing.X = slot_spacing.X < 0 ? imgsize.X * 0.25f :
+ imgsize.X * slot_spacing.X;
+ slot_spacing.Y = slot_spacing.Y < 0 ? imgsize.Y * 0.25f :
+ imgsize.Y * slot_spacing.Y;
+
+ slot_spacing.X += slot_size.X;
+ slot_spacing.Y += slot_size.Y;
} else {
slot_spacing.X = slot_spacing.X < 0 ? spacing.X :
slot_spacing.X * spacing.X;