drawArc and drawEllipseInRect are not drawing correctly

,
  1. If relevant, tell us what platform you're using the SDK on (Mac, Windows, Linux)
    Mac

  2. Explain what the expected result was and what happened instead.
    Expected arc to be drawn with a smooth line, but it appears to be cropped at times then jumps ahead of where it should be. It's only really evident at narrow line widths.

  3. Provide details on when and where this bug happens. Videos and images of the issue can be helpful.
    Consistently.
    bug2
    bug1

  4. Instructions on how to reproduce the issue.
    The demo code below will produce it in the simulator. I don't have a device to test it.

local gfx = playdate.graphics
import "CoreLibs/graphics"
gfx.setColor(gfx.kColorBlack)

local x, y = 200, 120
local radius = 40
local startAngle = 0
local endAngle = 90
local linewidth = 2

function playdate.update()
    startAngle +=1
    endAngle += 1
    gfx.clear()
    
    -- this looks fine (?)
    gfx.setLineWidth(20)
    gfx.drawArc(x, y, 20, startAngle, endAngle)
    
    -- this is broken
    gfx.setLineWidth(linewidth)
    gfx.drawArc(x, y, radius, startAngle, endAngle)
    
    -- this is fine
    gfx.drawCircleAtPoint(x, y, 3)
    
    -- this is fine
    gfx.setLineWidth(1)
    local innerX1 = 50 * math.cos((startAngle-90) * math.pi / 180) + x
    local innerY1 = 50 * math.sin((startAngle-90) * math.pi / 180) + y
    local outerX1 = 100 * math.cos((startAngle-90) * math.pi / 180) + x
    local outerY1 = 100 * math.sin((startAngle-90) * math.pi / 180) + y
    gfx.drawLine(innerX1, innerY1, outerX1, outerY1)
    local innerX1 = 50 * math.cos((endAngle-90) * math.pi / 180) + x
    local innerY1 = 50 * math.sin((endAngle-90) * math.pi / 180) + y
    local outerX1 = 100 * math.cos((endAngle-90) * math.pi / 180) + x
    local outerY1 = 100 * math.sin((endAngle-90) * math.pi / 180) + y
    gfx.drawLine(innerX1, innerY1, outerX1, outerY1)
end

1 Like

Noticed this same thing just yesterday actually, and incorrectly assumed it was something with the bounding box of my sprite. Increasing the lineWidth solved it for my needs, but it is definitely a noticeable visual glitch.

1 Like

filed, will fix soon! thanks!

2 Likes