-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
path string parsing fails for "super"-optimized strings #1145
Comments
Wow I didn't know that 00 is allowed. All other cases are covered. Good catch! |
@Fuzzyma |
strange, thought I caught that. But it was 5 years ago - so maybe my memory is just bad :D. |
hm ok, because of the |
@stranskyjan can 00 also occure in other path commands (for coodinates for example (e.g. M00)) or only for the flags in arc? |
@Fuzzyma according to browser test and the grammar for path data, |
Cool, in that case I have a working parser now. However, I want to combine it with changing the coordinates to absolute so I don't have 2 loops hanging around :) |
@stranskyjan just realized that your "correct" example is wrong. You test against absolute coordinates but use the relative coordinates in your example |
@Fuzzyma true, sorry, I put wrong numbers. But the main idea that there are numbers instead of |
Yes, ofc! I just wondered why my parser put out the wrong values :D |
Consider a path string
M2,0a2 2 0 00-2 2a2 2 0 002 2a.5.5 0 011 0z
, which seems to be valid (browsers natively renders it correctly), but is "super"-optimized:00
(instead of "standard"0 0
with space) symbol for the arc flags.0-2
(no delimiter in front of-
)a.5.5
(no delimiter in front of decimal separator)Using this in svg.js renders correctly, but
path.array()
method returnsbut should return
Bug report based on this stackoverflow discussion
jsfiddle
The text was updated successfully, but these errors were encountered: