diff options
Diffstat (limited to 'not')
-rw-r--r-- | not/Group.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/not/Group.lua b/not/Group.lua index 898d7f3..970d3bc 100644 --- a/not/Group.lua +++ b/not/Group.lua @@ -4,7 +4,7 @@ Group = require "not.Element":extends() function Group:new (parent) Group.__super.new(self, parent) self.children = {} - self.marign = 0 + self.margin = 0 end function Group:addChild (element) @@ -17,17 +17,17 @@ function Group:setPosition (x, y) local dx = 0 for _,child in ipairs(self.children) do child:setPosition(x + dx, y) - dx = dx + child:getSize() + self.marigin + dx = dx + child:getSize() + self.margin end return Group.__super.setPosition(self, x, y) end function Group:getSize () - local twidth = -self.marigin + local twidth = -self.margin local theight = 0 for _,child in ipairs(self.children) do local cwidth, cheight = child:getSize() - twidth = twidth + child:getSize() + self.marigin + twidth = twidth + child:getSize() + self.margin if theight < cheight then theight = cheight end |