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

Add a fix to work with shorthand multiple floats such as 1.2.3 #5

Closed
wants to merge 1 commit into from
Closed

Add a fix to work with shorthand multiple floats such as 1.2.3 #5

wants to merge 1 commit into from

Conversation

andydotxyz
Copy link
Contributor

@srwiley
Copy link
Owner

srwiley commented Nov 27, 2018

So, is this part of the SVG specification, or is this just some legacy of some editors? I suppose is does not hurt to put it in, but also, I am not a fan of using recursion for something this simple. Tell me more.

@andydotxyz
Copy link
Contributor Author

It appears to be in the specification:

Similarly, for the string "M 0.6.5", the first coordinate of the "moveto" consumes the characters "0.6" and stops upon encountering the second decimal point because the production of a "coordinate" only allows one decimal point. The result is that the first coordinate will be "0.6" and the second coordinate will be ".5". - https://www.w3.org/TR/SVG/paths.html#PathDataBNF

Recursion made sense as this is a standard head | tail problem as there is no limitation the the number of “.” That can appear (though in reality I have only seen 4)

@srwiley
Copy link
Owner

srwiley commented Nov 29, 2018

I have incorporated parsing this type of float shorthand in the latest version w/o the recursion. Thank you for bringing it to my attention.

@srwiley srwiley closed this Nov 29, 2018
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

Successfully merging this pull request may close these issues.

2 participants