You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
canvas: arcTo draws the long arc (three quarters of the circle) instead of the corner #97
CanvasRenderingContext2D.arcTo() draws the arc the long way round. For a right-angle corner it draws three quarters of the circle through the far side instead of the quarter arc between the two tangent points.
Where:sdk/ui/src/canvas/context.ts, last line of arcTo:
Tangent points are (5, 0) and (10, 5), centre (5, 5), so a0 = -π/2 and a1 = 0. The short arc runs clockwise, but cross is -100 here, so ccw is true and Path.ellipse turns the sweep into -3π/2: three cubics instead of one. The mirrored corner (arcTo(10, 0, 10, -10, 5), cross = 100) goes wrong the other way. roundRect in the same file builds the same corners with ellipse(..., false) and is fine.
Expected: one quarter arc from (5, 0) to (10, 5), as a browser draws it.
How I checked: by reading the code at 7099bb9 and with a bun test on the SDK's canvas context that counts the cubics in the path (3 on main, 1 with cross > 0). I have not compared a rendered frame against a browser. sdk/ui/parity/cases/p15-media/canvas-paths.tsx calls arcTo(460, 100, 460, 180, 20), so that case should show it.
The fix is that one character plus a test file (sdk/ui/test/canvas-arcto.test.ts). I have it on a branch and can send it as a PR if you'd like one.
Fixed on main in c89de2a, exactly your one character, with sdk/ui/test/canvas-arcto.test.ts checking both turning directions and a four-corner rounded rectangle by their cubics. Thanks for the precise report; since the fix was already written up here, I landed it directly rather than wait on a PR, so the credit is in the commit message. Closing.
Activity
canvas: arcTo draws the corner's short arc, as a browser does (#97)
shinyobjectz commentedon Nov 12, 2026
Fixed on main in c89de2a, exactly your one character, with
sdk/ui/test/canvas-arcto.test.tschecking both turning directions and a four-corner rounded rectangle by their cubics. Thanks for the precise report; since the fix was already written up here, I landed it directly rather than wait on a PR, so the credit is in the commit message. Closing.skills pin: raea-skills #97 (14ac66c), with #94 and #95: 0.1.6's refe…