Fix Flexbox offset, add alignItems attribute #66

Merged
thesabinelim merged 4 commits from patch-6 into master 2023-05-08 18:14:39 +08:00
Showing only changes of commit 6cd8e0ebb0 - Show all commits

View File

@@ -25,11 +25,11 @@ return function(name, basalt)
local availableSpace = (flexDirection == "row" and width or height) - totalChildSize - (spacing * (totalElements - 1))
local currentOffset = 0
local currentOffset = 1
if justifyContent == "center" then
currentOffset = availableSpace / 2
currentOffset = 1 + availableSpace / 2
elseif justifyContent == "flex-end" then
currentOffset = availableSpace
currentOffset = 1 + availableSpace
end
for _, obj in ipairs(objects) do
@@ -92,4 +92,4 @@ return function(name, basalt)
object.__index = object
return setmetatable(object, base)
end
end