core/menusystem: get widget size when redrawing and not at start
It's only relevant when drawing/redrawing
This commit is contained in:
parent
70853353bb
commit
7d42991d7a
1 changed files with 2 additions and 2 deletions
|
@ -12,8 +12,6 @@ function BaseWidget:new(menu)
|
||||||
|
|
||||||
self:register()
|
self:register()
|
||||||
|
|
||||||
self.width, self.height = self.menu:getWidgetSize()
|
|
||||||
|
|
||||||
self.canvas = {}
|
self.canvas = {}
|
||||||
self.canvas.texture = nil
|
self.canvas.texture = nil
|
||||||
self.canvas.needRedraw = true
|
self.canvas.needRedraw = true
|
||||||
|
@ -24,6 +22,8 @@ function BaseWidget:register()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BaseWidget:redrawCanvas()
|
function BaseWidget:redrawCanvas()
|
||||||
|
self.width, self.height = self.menu:getWidgetSize(self.id)
|
||||||
|
|
||||||
self.canvas.texture = love.graphics.newCanvas(self.width, self.height)
|
self.canvas.texture = love.graphics.newCanvas(self.width, self.height)
|
||||||
love.graphics.setCanvas( self.canvas.texture )
|
love.graphics.setCanvas( self.canvas.texture )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue