linebender / kurbo

A Rust library for manipulating curves
Apache License 2.0
716 stars 69 forks source link

fix: parsing scientific notation in SVG path #365

Closed GabrielDertoni closed 2 months ago

GabrielDertoni commented 2 months ago

Before this change

The SVG parsing code failed to parse scientific notation in BezPath. For example M 0 0 L 1e-123 -4E+5 would fail to parse with SvgParseError::Wrong even though it is a valid SVG path. This error was introduced by 8d10d4e which forgot to negate the conditional, causing the parser to fail when it should succeed.

After this change

The change fixes the error and adds a test for it.

GabrielDertoni commented 2 months ago

No need to give me write access yet (if I end up wanting to make larger contributions we can revisit). I am happy to just get this in whichever way is faster.

raphlinus commented 2 months ago

Thanks! I just added it to the merge queue.