I'm not on GitHub so I can't comment there, but I wanted to note that this is a problem with the default "miter" line join algorithm. The line drawing algorithm tries to draw a miter, but when there are duplicate points, doing a miter implies that the edges of the line at the joint would be parallel. See what happens when they are almost parallel:
Code: Select all
function love.draw()
love.graphics.setLineWidth(2)
love.graphics.line(750, 300, 400, 300, 750, 303)
end
All three test cases work just fine after setting the line join to none:
Code: Select all
love.graphics.setLineJoin("none")
function love.draw()
love.graphics.line(0, 0, 100, 100, 100, 100) -- a
love.graphics.line(10, 0, 60, 50, 60, 50, 110, 100) --b
love.graphics.line(20, 0, 70, 50, 120, 100, 70, 50) -- c
end