Skip to content
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

Feature request: support for Path2D #173

Open
jahnotto opened this issue Nov 8, 2023 · 3 comments
Open

Feature request: support for Path2D #173

jahnotto opened this issue Nov 8, 2023 · 3 comments

Comments

@jahnotto
Copy link

jahnotto commented Nov 8, 2023

It would be useful to be able to use a Path2D. Any chance this can be added?

Thanks for making such a great canvas wrapper!

@stefanloerwald
Copy link
Member

I suspect that this could be relatively easy to add, since the Path2D API looks rather small.

Unfortunately, I don't have the capacity to do any of this, but I'm happy to review pull requests.

@jahnotto
Copy link
Author

jahnotto commented Nov 8, 2023

Thanks for your super quick reply. Understandable -- I know the feeling!

As an alternative, I'm trying to use batch.StoreAsync(string path). However, this just gives me a black canvas if I try to pass an SVG like

await batch.StrokeAsync("M150 0 L75 200 L225 200 Z");

Should the path be defined with a different syntax than SVG?

@stefanloerwald
Copy link
Member

stefanloerwald commented Nov 8, 2023

Thanks for your super quick reply. Understandable -- I know the feeling!

As an alternative, I'm trying to use batch.StoreAsync(string path). However, this just gives me a black canvas if I try to pass an SVG like

await batch.StrokeAsync("M150 0 L75 200 L225 200 Z");

Should the path be defined with a different syntax than SVG?

Have a look at the sample code:

https://github.com/excubo-ag/Blazor.Canvas/blob/main/TestProject_Components/Pages/Context2D/DrawingPaths.razor#L115

The option to draw a path with a string argument is for referencing a path object by name. SVG is therefore not compatible here.

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

No branches or pull requests

2 participants