Skip to content

Canvas roundRect DOMPoint argument #1507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: CanvasTest
Choose a base branch
from

Conversation

Pheo
Copy link

@Pheo Pheo commented Apr 22, 2025

MDN: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
Adds support for single DOMPoint argument in roundRect (Context, Path2D)
Looks like nvgRoundedRectVarying already implemented seperate x/y radius, so just needed to add extra args

image

// DOMPoint
else if (radii.IsObject())
{
const auto dompoint = radii.As<Napi::Object>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : Same code as Context. We should create a utils.cpp file to store all these functions. Maybe when merging the big CanvasTest PR.

Copy link
Contributor

@CedricGuillemet CedricGuillemet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants