Skip to content

Support arc_to on Canvas#4158

Draft
corranwebster wants to merge 14 commits intobeeware:mainfrom
corranwebster:canvas-backend-features
Draft

Support arc_to on Canvas#4158
corranwebster wants to merge 14 commits intobeeware:mainfrom
corranwebster:canvas-backend-features

Conversation

@corranwebster
Copy link
Copy Markdown
Contributor

@corranwebster corranwebster commented Feb 2, 2026

The HTML Canvas has two path operations which are currently not supported by the Canvas widget: arcTo() and roundRect(). This PR implements arc_to() in a manner compatible with the HTML Canvas. This was originally going to include support for round_rect() as well, because I thought it would need arc_to() but it turned out not to, so I've split that into a separate PR for ease of review.

Issues:

  • arc_to() needs to know the current point in the path, which Android Graphics doesn't expose cleanly. We can track it manually, but that will need to Fix mid-path transforms #4106 to be merged before it could be done properly.
  • arc_to() on winforms is drawing an extra line (or an extra-long line) in the test, and I can't work out what's going on. My suspicion is that it is to do with the non-standard way winforms handles paths, but I don't know where it's going wrong. Concretely, it seems to be drawing the connecting line to the first curve from (115, 10) to (80, 10) instead of (90, 10). Otherwise all is correct. This could be an existing issue with the way it draws Bézier curves or lines.

Ref #3994

To Do:

  • Implement arc_to
    • ...on Android
    • ...on Winforms

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@corranwebster corranwebster changed the title Support arc_to and round_rect on Canvas Support arc_to on Canvas Feb 3, 2026
@corranwebster
Copy link
Copy Markdown
Contributor Author

Deferring this until #4163 is completed, as I think that will make the implementation on Windows and Android much easier.

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.

1 participant