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

[Enhancement] Move Two.Utils.read.XXX to Two.XXX.parse #650

Open
jonobr1 opened this issue Jul 29, 2022 · 0 comments
Open

[Enhancement] Move Two.Utils.read.XXX to Two.XXX.parse #650

jonobr1 opened this issue Jul 29, 2022 · 0 comments
Milestone

Comments

@jonobr1
Copy link
Owner

jonobr1 commented Jul 29, 2022

Is your feature request related to a problem? Please describe.
Currently the SVG interpreter relies on replicating SVG strings into elements and parsing them iteratively in a big for loop. This does not give developers the ability to parse individual elements ad hoc. Moving each read function to a static parse method on each object would allow for parsing of entire scenes as well as ad hoc parsing.

Describe the solution you'd like
For all shape primitives to have a parse method that works something like this:

const path = Two.Path.parse('<path d="..." fill="red" stroke="transparent" />');
two.add(path);

Additional context
This will improve code portability and make this issue more feasible.

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

No branches or pull requests

1 participant