Page MenuHome

Gpencil: Fix for SVG import arc and float errors
ClosedPublic

Authored by Erik Abrahamsson (erik85) on Apr 27 2021, 5:10 PM.

Details

Summary

Fix for the Arc commands (A/a) to successfully parse the 4th and 5th arguments.
Fix for floats without a specified integer part, like .123

File for testing:

Diff Detail

Repository
rB Blender

Event Timeline

Erik Abrahamsson (erik85) requested review of this revision.Apr 27 2021, 5:10 PM
Erik Abrahamsson (erik85) created this revision.
source/blender/io/gpencil/nanosvg/nanosvg.h
2417

IRC, you can use the preferred format:

if (*s && (ELEM(cmd, 'a', 'A')) && (ELEM(nargs, 3, 4))) {

Erik Abrahamsson (erik85) marked an inline comment as done.
Erik Abrahamsson (erik85) edited the summary of this revision. (Show Details)

Updated according to comment.

source/blender/io/gpencil/nanosvg/nanosvg.h
1577

Why does this need to be a while loop? I think if was correct here.

source/blender/io/gpencil/nanosvg/nanosvg.h
1577

To remove -. if present.

Erik Abrahamsson (erik85) marked an inline comment as done.

Moved special case from main loop to nsvg__getNextPathItem

This revision is now accepted and ready to land.Apr 27 2021, 7:53 PM

I noticed there was a fix commited for the float error at nanosvg on github so I changed the patch to match that.