From 8d6cc58c137be3ca851ffa3e0086cb5dd97c51bc Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Mon, 13 Oct 2025 22:21:42 -0400 Subject: [PATCH] working on tests --- FlexLove.lua | 5 ++++- testing/__tests__/01_absolute_positioning_basic_tests.lua | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/FlexLove.lua b/FlexLove.lua index 3816257..946b1ab 100644 --- a/FlexLove.lua +++ b/FlexLove.lua @@ -2878,13 +2878,16 @@ function Element:layoutChildren() elseif self.justifyContent == JustifyContent.SPACE_BETWEEN then startPos = 0 if #line > 1 then + -- Gap already accounted for in freeSpace calculation itemSpacing = self.gap + (freeSpace / (#line - 1)) end elseif self.justifyContent == JustifyContent.SPACE_AROUND then + -- Gap already accounted for in freeSpace calculation local spaceAroundEach = freeSpace / #line startPos = spaceAroundEach / 2 itemSpacing = self.gap + spaceAroundEach elseif self.justifyContent == JustifyContent.SPACE_EVENLY then + -- Gap already accounted for in freeSpace calculation local spaceBetween = freeSpace / (#line + 1) startPos = spaceBetween itemSpacing = self.gap + spaceBetween @@ -3766,4 +3769,4 @@ Gui.new = Element.new Gui.Element = Element Gui.Animation = Animation Gui.Theme = Theme -return { GUI = Gui, Color = Color, Theme = Theme, enums = enums } +return { GUI = Gui, Gui = Gui, Element = Element, Color = Color, Theme = Theme, Animation = Animation, enums = enums } diff --git a/testing/__tests__/01_absolute_positioning_basic_tests.lua b/testing/__tests__/01_absolute_positioning_basic_tests.lua index e4bd3cd..ee62a5e 100644 --- a/testing/__tests__/01_absolute_positioning_basic_tests.lua +++ b/testing/__tests__/01_absolute_positioning_basic_tests.lua @@ -664,7 +664,7 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() }) -- Verify stacking order by z-index - luaunit.assertEquals(background.z, 1) + luaunit.assertEquals(backgroundColor.z, 1) luaunit.assertEquals(middleParent.z, 5) luaunit.assertEquals(middleChild1.z, 1) luaunit.assertEquals(middleChild2.z, 2)