From ad9adcb88444b4a7063d5c2f5debd85729e8ce42 Mon Sep 17 00:00:00 2001 From: Vincent Robinson Date: Sat, 23 Jan 2021 14:49:13 -0800 Subject: Fix formspec list spacing (#10861) --- src/gui/guiFormSpecMenu.cpp | 11 +++++++---- 1 file 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; -- cgit v1.2.3