mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Fix nested list positioning issues
This commit is contained in:
parent
7f8963b3e1
commit
a3fb10f0fd
@ -135,23 +135,23 @@ function newobject:update(dt)
|
||||
end
|
||||
end
|
||||
|
||||
self:CheckHover()
|
||||
|
||||
local parent = self.parent
|
||||
local base = loveframes.base
|
||||
local update = self.Update
|
||||
local internals = self.internals
|
||||
|
||||
for k, v in ipairs(internals) do
|
||||
v:update(dt)
|
||||
end
|
||||
|
||||
-- move to parent if there is a parent
|
||||
if parent ~= base then
|
||||
self.x = parent.x + self.staticx
|
||||
self.y = parent.y + self.staticy
|
||||
end
|
||||
|
||||
self:CheckHover()
|
||||
|
||||
for k, v in ipairs(internals) do
|
||||
v:update(dt)
|
||||
end
|
||||
|
||||
if update then
|
||||
update(self, dt)
|
||||
end
|
||||
|
@ -60,6 +60,8 @@ function newobject:update(dt)
|
||||
end
|
||||
end
|
||||
|
||||
self:CheckHover()
|
||||
|
||||
local internals = self.internals
|
||||
local children = self.children
|
||||
local display = self.display
|
||||
@ -74,10 +76,12 @@ function newobject:update(dt)
|
||||
self.y = self.parent.y + self.staticy
|
||||
end
|
||||
|
||||
self:CheckHover()
|
||||
|
||||
for k, v in ipairs(internals) do
|
||||
v:update(dt)
|
||||
for _, p in pairs(self:GetParents()) do
|
||||
v.x = v.x - (p.offsetx or 0)
|
||||
v.y = v.y - (p.offsety or 0)
|
||||
end
|
||||
end
|
||||
|
||||
local x = self.x
|
||||
@ -92,6 +96,10 @@ function newobject:update(dt)
|
||||
v:SetClickBounds(x, y, width, height)
|
||||
v.x = (v.parent.x + v.staticx) - offsetx
|
||||
v.y = (v.parent.y + v.staticy) - offsety
|
||||
for _, p in pairs(self:GetParents()) do
|
||||
v.x = v.x - (p.offsetx or 0)
|
||||
v.y = v.y - (p.offsety or 0)
|
||||
end
|
||||
if display == "vertical" then
|
||||
if v.lastheight ~= v.height then
|
||||
self:CalculateSize()
|
||||
|
Loading…
Reference in New Issue
Block a user