chore: make canvas redraw part of canvas
This commit is contained in:
parent
339d927d51
commit
6f6b4e6d74
2 changed files with 8 additions and 4 deletions
|
@ -19,6 +19,13 @@ function CanvasElement:initCanvas()
|
|||
self.canvas.padding = 8
|
||||
end
|
||||
|
||||
function CanvasElement:updateElement(dt)
|
||||
CanvasElement.super.updateElement(self, dt)
|
||||
if (self.canvas.needRedraw or self.canvas.isAnimated) then
|
||||
self:redraw()
|
||||
end
|
||||
end
|
||||
|
||||
function CanvasElement:getCanvasDimensions()
|
||||
return self:getDimensions()
|
||||
end
|
||||
|
|
|
@ -140,11 +140,8 @@ end
|
|||
-- UPDATE FUNCTIONS
|
||||
|
||||
function Menu:updateElement(dt)
|
||||
Menu.super.updateElement(self, dt)
|
||||
self.widget:update(dt)
|
||||
if (self.canvas.needRedraw or self.canvas.isAnimated) then
|
||||
self:redraw()
|
||||
end
|
||||
Menu.super.updateElement(self, dt)
|
||||
end
|
||||
|
||||
-- DRAW FUNCTIONS
|
||||
|
|
Loading…
Reference in a new issue