Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Classes/Control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ local rect = {
---@field shown Prop<boolean>
---@field x Prop<number>?
---@field y Prop<number>?
---@field collapseY number? An additional offset which is applied when this control uses a collapsed anchor.
---@field collapseX number? An additional offset which is applied when this control uses a collapsed anchor.
local ControlClass = newClass("Control")

---@alias ControlAnchor [AnchorPoint, Control|ControlHost, AnchorPoint, boolean|nil]
Expand Down Expand Up @@ -87,7 +89,10 @@ end

function ControlClass:GetPos()
if self.anchor.collapse and self.anchor.other and not self.anchor.other:GetProperty("shown") then
return self.anchor.other:GetPos()
local x, y = self.anchor.other:GetPos()
x = x + (self.collapseX or 0)
y = y + (self.collapseY or 0)
return x, y
end
local x = self:GetProperty("x")
local y = self:GetProperty("y")
Expand Down
Loading
Loading