core/menusystem: fix widget size in gridbox
This commit is contained in:
parent
7d42991d7a
commit
864c1c31a3
1 changed files with 6 additions and 6 deletions
|
@ -7,7 +7,7 @@ function GridBox:new(menusystem, name, x, y, w, h, colNumber, lineNumber)
|
|||
self.view = {}
|
||||
self.view.slotNumber = colNumber * lineNumber
|
||||
self.view.colNumber = colNumber
|
||||
self.view.colNumber = lineNumber
|
||||
self.view.lineNumber = lineNumber
|
||||
GridBox.super.new(self, menusystem, name, x, y, w, h)
|
||||
self.begin = 1
|
||||
self.h = lineNumber * self.widget.h -- On fait en sorte que la hauteur
|
||||
|
@ -30,13 +30,13 @@ function GridBox:new(menusystem, name, x, y, w, h, colNumber, lineNumber)
|
|||
end
|
||||
|
||||
function GridBox:updateWidgetSize()
|
||||
self.widget.h = math.floor( self.h / self.view.colNumber )
|
||||
self.widget.h = math.floor( self.h / self.view.lineNumber )
|
||||
self.widget.w = math.floor( self.w / self.view.colNumber )
|
||||
end
|
||||
|
||||
function GridBox:getWidgetSize(id)
|
||||
local slot = self:getWidgetSlot(id)
|
||||
return self.slots[slot].width, self.slots[slot].height
|
||||
return self.widget.w * self.slots[slot].width, self.widget.h * self.slots[slot].height
|
||||
end
|
||||
|
||||
function GridBox:getWidgetSlot(widgetID)
|
||||
|
|
Loading…
Reference in a new issue