The columnlistarea object will only update its children if they are within its boundaries

This commit is contained in:
Kenny Shields 2014-01-20 17:19:21 -05:00
parent 7c4b3b9804
commit 6cede1d844

View File

@ -73,7 +73,10 @@ function newobject:update(dt)
end end
for k, v in ipairs(children) do for k, v in ipairs(children) do
v:update(dt) local col = loveframes.util.BoundingBox(self.x, v.x, self.y, v.y, self.width, v.width, self.height, v.height)
if col then
v:update(dt)
end
v:SetClickBounds(self.x, self.y, self.width, self.height) v:SetClickBounds(self.x, self.y, self.width, self.height)
v.y = (v.parent.y + v.staticy) - self.offsety + cheight v.y = (v.parent.y + v.staticy) - self.offsety + cheight
v.x = (v.parent.x + v.staticx) - self.offsetx v.x = (v.parent.x + v.staticx) - self.offsetx
@ -133,7 +136,7 @@ function newobject:draw()
for k, v in ipairs(children) do for k, v in ipairs(children) do
local col = loveframes.util.BoundingBox(self.x, v.x, self.y, v.y, self.width, v.width, self.height, v.height) local col = loveframes.util.BoundingBox(self.x, v.x, self.y, v.y, self.width, v.width, self.height, v.height)
if col == true then if col then
v:draw() v:draw()
end end
end end