-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow to apply transform to path #36
Comments
This is the same as issue #31, although the title doesn't make that obvious, so I'll keep both open. |
Any complex number can z can be represented with the matrix. Which means just doing typical operations with in complex numbers. For scale, multiply by scale (no imaginary part). For you skew matrix we need to multiply by a value that has two different imaginary components so I think that's a convert back to reals do the math and put it back. Given his code doesn't do anything other than parse SVG paths into Path objects he should generally just allow for scale, rotate, and translation objects on all the elements there as well as the path object itself. Which means just doing those operations on particular elements. I think a couple functions like:
would do it. |
As described in https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform
it's common for svg
<path>
element to havetransform=""
attributetypicaly it looks something like this:
Can you please add possibility to apply this transformation if supplied to svg.path during parsing stage? In fact only support for rotate(), translate() and scale() is needed in most cases. It should be pretty easy to do.
In ideal case svg.path would take two individual strings: d attribute and transform attribute.
It would be also perfect, if i can just supply whole
<path ... />
string and svg.path would extract the data from it, so i don't need to parse it by myself. Or even whole SVG file, which would in turn get exploded into multiple paths.Thanks
The text was updated successfully, but these errors were encountered: