|
@@ -1383,19 +1383,16 @@ end
|
|
|
-- love.graphics.points
|
|
|
love.test.graphics.points = function(test)
|
|
|
local canvas = love.graphics.newCanvas(16, 16)
|
|
|
- love.graphics.setCanvas(canvas)
|
|
|
+ love.graphics.push("all")
|
|
|
+ love.graphics.setCanvas(canvas)
|
|
|
love.graphics.clear(0, 0, 0, 1)
|
|
|
+ love.graphics.translate(0.5, 0.5) -- draw points at the center of pixels
|
|
|
love.graphics.setColor(1, 0, 0, 1)
|
|
|
- love.graphics.points(1,1,16,1,16,16,1,16,1,1)
|
|
|
+ love.graphics.points(0,0,15,0,15,15,0,15,0,0)
|
|
|
love.graphics.setColor(1, 1, 0, 1)
|
|
|
- love.graphics.points({2,2,8,8,15,2,8,9,15,15,9,9,2,15,9,8})
|
|
|
- love.graphics.setColor(1, 1, 1, 1)
|
|
|
- love.graphics.setCanvas()
|
|
|
+ love.graphics.points({1,1,7,7,14,1,7,8,14,14,8,8,1,14,8,7})
|
|
|
+ love.graphics.pop()
|
|
|
local imgdata = love.graphics.readbackTexture(canvas)
|
|
|
- -- on macOS runners points are drawn 1px off from the target
|
|
|
- if GITHUB_RUNNER and love.system.getOS() == 'OS X' then
|
|
|
- test.pixel_tolerance = 1
|
|
|
- end
|
|
|
test:compareImg(imgdata)
|
|
|
end
|
|
|
|