fix: utilisation du padding comme il faut
This commit is contained in:
parent
fa8f59cf2c
commit
cf6cd3c7a3
1 changed files with 3 additions and 3 deletions
|
@ -50,15 +50,15 @@ function CanvasElement:parseOrigin(origin, size)
|
||||||
if (origin == "center") then
|
if (origin == "center") then
|
||||||
return size/2
|
return size/2
|
||||||
elseif (origin == "end") then
|
elseif (origin == "end") then
|
||||||
return size - self.canvas.padding
|
return size
|
||||||
else
|
else
|
||||||
return origin or self.canvas.padding
|
return origin or 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function CanvasElement:draw()
|
function CanvasElement:draw()
|
||||||
love.graphics.setColor(1, 1, 1, self.opacity)
|
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)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue