Merge pull request #32 from TotoEnF5/layout
fix uninitialized variables in container layout
This commit is contained in:
commit
c40b3eb953
@ -53,20 +53,19 @@ end
|
|||||||
|
|
||||||
function container:draw(x, y, width, height, children, hpad, vpad, alignX)
|
function container:draw(x, y, width, height, children, hpad, vpad, alignX)
|
||||||
local w, h = children[1]:getSize()
|
local w, h = children[1]:getSize()
|
||||||
local x, y
|
|
||||||
|
|
||||||
if self.halign == 'stretch' then
|
if self.halign == 'stretch' then
|
||||||
w = width
|
w = width
|
||||||
x = x
|
x = x
|
||||||
else
|
else
|
||||||
x = alignHandlerX(self.halign, containerX, containerWidth, w)
|
x = alignHandlerX(self.halign, x, width, w)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.valign == 'stretch' then
|
if self.valign == 'stretch' then
|
||||||
h = h
|
h = height
|
||||||
y = y
|
y = y
|
||||||
else
|
else
|
||||||
y = alignHandlerY(self.valign, containerY, containerHeight, h)
|
y = alignHandlerY(self.valign, y, height, h)
|
||||||
end
|
end
|
||||||
|
|
||||||
children[1]:draw(x, y, w, h)
|
children[1]:draw(x, y, w, h)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user