svgdotjs/svg.import.js

Objects appear at the wrong position

jeroenmoors opened this issue · 3 comments

Hi,

I've created a SVG-file with Inkscape. Most of it is shown correctly except some objects are shown at the wrong position.

I really would like to fix this, however I'm not very familiar with SVG. Could you provide me any clue where I should start digging?

I've uploaded an example here:
http://infographic.dev.fluoline.net/

The original SVG can be found here: http://infographic.dev.fluoline.net/parts/timeline.svg

Thanks for your input!

Jeroen

Hi,

I think this issue is related to matrix transformations.

When the matrix transformation is parsed, the value is parsed with parseFloat or the default is used. In cases where the provide value is 0 I think it uses the default value. This isn't always the expected case.

For now I've just removed the or and always use the value from the svg-file, see from line 167:

https://github.com/jeroenmoors/svg.import.js/blob/779260f63dd7a606c8abf42c837419b5fc9b9e5b/svg.import.js

Jeroen

wout commented

This should be fixed in the latest version. Could you confirm this?

Yes! Works as expected.