From 6834bf8563e540486573abb14a9e1ee710c0817a Mon Sep 17 00:00:00 2001 From: Mike Freno Date: Mon, 15 Sep 2025 00:02:48 -0400 Subject: [PATCH] better sizing, margin and padding --- FlexLove.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FlexLove.lua b/FlexLove.lua index 8313e85..5bbb549 100644 --- a/FlexLove.lua +++ b/FlexLove.lua @@ -243,6 +243,8 @@ end ---@field textColor Color ---@field textAlign TextAlign ---@field gap number +---@field px number +---@field py number ---@field positioning Positioning -- default: ABSOLUTE ---@field flexDirection FlexDirection -- default: horizontal ---@field justifyContent JustifyContent -- default: start @@ -263,6 +265,8 @@ Window.__index = Window ---@field borderColor Color? -- default: black? -- default: none ---@field background Color? --default: transparent ---@field gap number? -- default: 10 +---@field px number? -- default: 0 +---@field py number? -- default: 0 ---@field text string? -- default: nil ---@field titleColor Color? -- default: black ---@field textAlign TextAlign? @@ -314,6 +318,8 @@ function Window.new(props) end self.gap = props.gap or 10 + self.px = props.px or 0 + self.py = props.py or 0 self.text = props.text self.textColor = props.textColor @@ -371,11 +377,8 @@ function Window:layoutChildren() if self.positioning == Positioning.ABSOLUTE then return end - Logger:debug("width before: " .. self.width) self:calculateAutoWidth() - Logger:debug("width after: " .. self.width) - -- Calculate total size of children local totalSize = 0 local childCount = #self.children