Fix formspec list spacing (#10861)

This commit is contained in:
Vincent Robinson 2021-01-23 14:49:13 -08:00 committed by GitHub
parent 6a55c03dab
commit ad9adcb884
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -507,10 +507,13 @@ void GUIFormSpecMenu::parseList(parserData *data, const std::string &element)
v2f32 slot_spacing = style.getVector2f(StyleSpec::SPACING, v2f32(-1, -1)); v2f32 slot_spacing = style.getVector2f(StyleSpec::SPACING, v2f32(-1, -1));
if (data->real_coordinates) { if (data->real_coordinates) {
slot_spacing.X = slot_spacing.X < 0 ? imgsize.X * 1.25f : slot_spacing.X = slot_spacing.X < 0 ? imgsize.X * 0.25f :
slot_spacing.X * imgsize.X + imgsize.X; imgsize.X * slot_spacing.X;
slot_spacing.Y = slot_spacing.Y < 0 ? imgsize.Y * 1.25f : slot_spacing.Y = slot_spacing.Y < 0 ? imgsize.Y * 0.25f :
slot_spacing.Y * imgsize.Y + imgsize.Y; imgsize.Y * slot_spacing.Y;
slot_spacing.X += slot_size.X;
slot_spacing.Y += slot_size.Y;
} else { } else {
slot_spacing.X = slot_spacing.X < 0 ? spacing.X : slot_spacing.X = slot_spacing.X < 0 ? spacing.X :
slot_spacing.X * spacing.X; slot_spacing.X * spacing.X;