mapbox / spritezero

small opinionated sprites
Other
173 stars 62 forks source link

Spritezero produces invalid content boxes #96

Open dwoznicki opened 2 years ago

dwoznicki commented 2 years ago

Running spritezero on certain SVGs with a content box that is close to the edge of the bounding box sometimes produces a content box that extends beyond the bounds of the sprite.

For example, when I create a spritesheet from the SVG below using the JS snippet in the README, I get the following output.

SVG content ```xml image/svg+xml ```
{"US:AR_airport":{"width":22,"height":21,"x":0,"y":0,"pixelRatio":1,"content":[4,15,17.5,21.5]}}

While the height is 21px, the bottom right corner of the content box is set at 21.5px. This box is invalid, and causes my tileserver to choke when trying to load the spritesheet.