diff options
author | Vincent Robinson <robinsonvincent89@gmail.com> | 2021-01-23 14:49:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-23 14:49:13 -0800 |
commit | ad9adcb88444b4a7063d5c2f5debd85729e8ce42 (patch) | |
tree | 72f91e5e00c2a5fff1016a32a262df85594e913b | |
parent | 6a55c03dabf7b5337233fc80078a300d485fcec4 (diff) | |
download | minetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.tar.gz minetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.tar.bz2 minetest-ad9adcb88444b4a7063d5c2f5debd85729e8ce42.zip |
Fix formspec list spacing (#10861)
-rw-r--r-- | src/gui/guiFormSpecMenu.cpp | 11 |
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; |