Closed akien-mga closed 4 years ago
Here's one of those icons which are now broken with e7f5981: ToolMove.zip
The full icon set is in https://github.com/godotengine/godot/tree/master/editor/icons
I tried this ToolMove.svg
icon with the example code in https://github.com/memononen/nanosvg/tree/master/example (by replacing 23.svg
and nano.svg
, here's the output in e7f5981:
(Second screenshot upscaled by 1600%.)
Here's how it looks like with e7f5981 reverted:
(All these icons are MIT licensed, you're welcome to use any of them as regression test material.)
The following patch fixes the regression:
Change line 1477 of nanosvg.h from:
To:
Valid floating point numbers may start by a dot.
With this the icon displays as expected.
And of course the comment at the previous line may be updated.
Fix pushed to Tk: https://core.tcl-lang.org/tk/info/2b07cb2b9e86e2c4
Great work. Also pushed to https://github.com/oehhar/tksvg
Thank you, Francois, that you care so well !
Thanks, Harald
@fvogelnew1 Do you want to make a PR to this repo so that @memononen can merge it when they get to it? (And for other downstream users to have a clearly visible PR to cherry-pick in the meantime.)
@akien-mga Thanks for debugging it, and @fvogelnew1 thanks for the PR. Merged.
We use nanosvg in https://github.com/godotengine/godot, and after syncing with the current
master
branch, most of our SVG icons end up broken (downstream issue).I bisected the regression to:
CC @memononen
I haven't investigated further yet to see if it's actually most Godot icons which are invalid, or if it's indeed a wrong change in e7f5981b1efef8cb5db6f62915ca4e25482b1e5b.
For the reference, here's the relevant Godot code that uses nanosvg to import SVG files as textures: https://github.com/godotengine/godot/blob/master/modules/svg/image_loader_svg.cpp