SVGMeshUnity icon indicating copy to clipboard operation
SVGMeshUnity copied to clipboard

Problem with closing (z/Z)

Open vonagam opened this issue 7 years ago • 0 comments

Hi, thanks for library.

Found some problem in SVGData. I had simple path and when i loaded it with .Path everything worked fine, but when i manually called .Line and then .Close it didn't show.

Turns out that there are two bugs:

  1. Because z command does not have arguments, this check in LoadCommand prevents z command from loading and calling .Close. (numArgs will always be 0, as will argsIndex at the start)

  2. .Close method just makes line to .Start position. The problem is that .Start position never have been changed from Vector2.zero. That is why currently it makes opposite of closing shape - opening it if first point wasn't zero. (That's why my line which is actually is closed, loaded ok with .Path, but failed to show when i called .Close)

vonagam avatar Oct 28 '18 20:10 vonagam