fix: utilisation du padding comme il faut

This commit is contained in:
Kazhnuz 2021-08-28 18:07:29 +02:00
parent fa8f59cf2c
commit cf6cd3c7a3

View file

@ -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