I'm trying to create an SVG polygon from with Javascript.
When I try to creating an SVGPoint with this Javascript code:
var p = new SVGPoint();
I'm getting the following message: - TypeError: Illegal constructor
From your SVG document you need to call .createSVGPoint()
to create a new point (initlaized at 0,0
), like this:
var p = svgRoot.createSVGPoint();
SVGPoint
(the interface itself) has no constructor, that's why you're getting an error currently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With