-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Don't auto-split SVG floats before a -. #21123
Conversation
Please change the |
Related (same topic): #17306 |
This is necessary to support numbers like 1e-6 with a - in the middle, which happens in SVG produced by Inkscape.
Done, thanks for the pointer. |
This PR breaks the
|
I've come to a regexp that passes all tests. Keep in mind that I'm no expert, I'd like it to be verified: For comparison, here is the previous regexp used in the repo: |
Alternatively to a different regex, I've implement Here is the commit: Mugen87@a2b9ed8
|
One thing that confuses me: The loader currently uses It seems |
I think you should implement It is difficult to integrate units as it is right now... |
|
Yes, I see. But the unit is just a string at the end, I think it should be not much work to add a new state to the parser. |
@ppvg Is it possible that a list of coordinates in SVG documents such as the points attribute of a |
@Mugen87: oof, I wrote that 7 years ago. I'll have to refresh my memory. 😅 |
@yomboprime Do you mind sharing a SVG file in this thread which can be used to evaluate the units issue? |
According to my today's research SVG transform as well as shape definitions (like path, polygon or polyline) do not support units. Hence, it should be safe to not use However, it would be good if this could be double-checked 😅 . |
The test "Units" loads the file |
I've made some reading of 1.1 and 2.0 SVG specs and it seems to be true. |
Okay, let's give this PR a try. In this way, the more time we have to validate the change on |
Just as a final note, the OP's SVG test file |
This is necessary to support numbers like 1e-6 with a - in the middle,
which happens in SVG produced by Inkscape.
Description
When SVGLoader loads an SVG file with a number like 1e-6 in a path, it parses that path incorrectly resulting in broken behavior. Because standard SVG-editing tools like Inkscape produce SVGs that contain numbers of this form, it can be easy to inadvertently produce SVGs that have this issue.
The attached broken.svg.zip contains a file that is handled correctly after this change and not before it.