I’m trying to programatically create a svg node like this
const parser = new DOMParser()
const doc = parser.parseFromString(mySvgAsString, 'image/svg+xml')
const svg = doc.children[0]
Everything seems to work fine, however when I try to use the isPointInFill
method, it always returns false. Like this:
const pathNode = svgNode.children[0]
const point = svgNode.createSVGPoint()
point.x = 5
point.y = 5
pathNode.isPointInFill(p) // always false
I created a fiddle that loads a svg square when iterates throught a 10 * 10 matrix – they all return false.
Fiddle https://jsfiddle.net/9hyp51cg/
I noticed that also functions like getBBox() on the svg return 0 as width / height. I’d suppose this is connected to this behaviour