Skip to content

Conversation

@CorleoneYu
Copy link

@CorleoneYu CorleoneYu commented Nov 17, 2025

Fix arcTo implementation issues

Description

#101
This PR fixes several issues in the arcTo method implementation:

Changes

  • Improved arcTo calculation logic: Refactored the arcTo method with better geometric calculations and error handling.
  • Added new test case arcTo3.js to verify the fix
  • Updated playground.html to include the new test case

Testing

Added a new test case test/example/arcTo3.js that demonstrates the fix:

window.C2S_EXAMPLES['arcTo3'] = function (ctx) {
    ctx.beginPath();
    ctx.moveTo(16,70);
    ctx.arcTo(16,74,20,74,4);
    ctx.stroke();
    ctx.closePath();
};

this case:
old
企业微信截图_69910762-d762-4c0f-ab74-ebebf174cd73

fixed
image

Related Issue

fixed
image

Fixes #101

Checklist

  • Added test case as required by the project guidelines
  • Code follows existing style and conventions
  • All tests pass

@murkle
Copy link

murkle commented Nov 17, 2025

This version isn't maintained any more. This is a newer maintained version: https://github.com/zenozeng/svgcanvas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arcTo doesn't handle counterclockwise arcs

2 participants