This commit is contained in:
Michael Freno
2025-09-18 15:43:24 -04:00
parent 7b9116577e
commit 92bfc61a3d

View File

@@ -596,12 +596,12 @@ function Element:layoutChildren()
goto continue goto continue
end end
if self.flexDirection == FlexDirection.VERTICAL then if self.flexDirection == FlexDirection.VERTICAL then
-- Position relative to parent origin along Y-axis (main axis) -- Position relative to parent origin
child.x = self.x + (self.margin.left or 0) child.x = self.x + (self.margin.left or 0)
child.y = self.y + currentPos child.y = self.y + currentPos
-- Apply alignment to cross axis (X-axis for vertical flex direction) -- Apply alignment to vertical axis (alignItems)
if self.alignItems == AlignItems.FLEX_START then if self.alignItems == AlignItems.FLEX_START then
-- nothing -- nothing
elseif self.alignItems == AlignItems.CENTER then elseif self.alignItems == AlignItems.CENTER then
@@ -691,7 +691,7 @@ if self.flexDirection == FlexDirection.VERTICAL then
-- This would be handled by the justifyContent logic already, so we'll keep existing behavior -- This would be handled by the justifyContent logic already, so we'll keep existing behavior
end end
currentPos = currentPos + (child.height or 0) + self.gap currentPos = currentPos + (child.height or 0) + self.gap + (self.margin.top or 0) + (self.margin.bottom or 0)
else else
-- Horizontal layout: position relative to parent origin -- Horizontal layout: position relative to parent origin
child.x = self.x + currentPos + (self.margin.left or 0) child.x = self.x + currentPos + (self.margin.left or 0)