From cf6cd3c7a3232599cf6027a6973cb1d427052bd5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Aug 2021 18:07:29 +0200 Subject: [PATCH] fix: utilisation du padding comme il faut --- sonic-radiance.love/birb/modules/gui/elements/canvas.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/birb/modules/gui/elements/canvas.lua b/sonic-radiance.love/birb/modules/gui/elements/canvas.lua index a1f654e..616efc0 100644 --- a/sonic-radiance.love/birb/modules/gui/elements/canvas.lua +++ b/sonic-radiance.love/birb/modules/gui/elements/canvas.lua @@ -50,15 +50,15 @@ function CanvasElement:parseOrigin(origin, size) if (origin == "center") then return size/2 elseif (origin == "end") then - return size - self.canvas.padding + return size else - return origin or self.canvas.padding + return origin or 0 end end function CanvasElement:draw() love.graphics.setColor(1, 1, 1, self.opacity) - love.graphics.draw(self.canvas.texture, self.x,self.y,self.r,self.sx,self.sy,self.ox,self.oy) + love.graphics.draw(self.canvas.texture, self.x - self.canvas.padding,self.y - self.canvas.padding,self.r,self.sx,self.sy,self.ox,self.oy) love.graphics.setColor(1, 1, 1, 1) end