Lines with large values sometimes have unexpected line width

I was scaling some polygons with some large values and noticed some lines were not rendered properly when I was setting the line width.

white =
black =

local polyReference =, 50, 500, 50)
local polyIssue =, 150, 33782, 150)

function playdate.update() black ) white ), 200, 33782, 200)

The top line is the reference and use the proper line width of 3 pixels. The bottom one are larger than that.

The issue doesn’t happened when the line width is set to 1.

fixed! Typical integer overflow problem, dx and dy were ints here: float d = dx*dx+dy*dy;

1 Like