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

Removes the close path #15

Open
asdf23 opened this issue Jan 16, 2024 · 0 comments
Open

Removes the close path #15

asdf23 opened this issue Jan 16, 2024 · 0 comments

Comments

@asdf23
Copy link

asdf23 commented Jan 16, 2024

The close paths are droped when using this.

var normalize = require('normalize-svg-path')
var parse = require("parse-svg-path")

Notice that parse does this correctly:

parse("M0 0L10 10A10 10 0 0 0 20 20 Z M10,10 Z")
[
  [ 'M', 0, 0 ],
  [ 'L', 10, 10 ],
  [
    'A', 10, 10, 0,
    0,   0,  20, 20
  ],
  [ 'Z' ],                                //<--- close path
  [ 'M', 10, 10 ],
  [ 'Z' ]                                // <--- close path
]

Normalize introduces an error

> normalize(parse("M0 0L10 10A10 10 0 0 0 20 20 Z M10,10Z"))
[
  [ 'M', 0, 0 ],
  [
    'C', 0,  0,  10,
    10,  10, 10
  ],
  [
    'C',
    10.000000000000002,
    15.51915024494,
    14.480849755060001,
    20,
    20,
    20
  ],
  [
    'C', 20, 20, 0,
    0,   0,  0
  ],
                                    //<--- missing
  [ 'M', 10, 10 ],
  [
    'C', 10, 10, 10,
    10,  10, 10
  ]
                                   //<--- missing
]
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

No branches or pull requests

1 participant