svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
10.97k stars 1.07k forks source link

Create SVG #1259

Closed logrox closed 2 years ago

logrox commented 2 years ago

Hi.

After upgrading from 3.1.1 to 3.1.2 I get a bug from SVG (). I include working code for version 3.1.1. After changing to 3.1.2, an error appears in the nodeOrNew () method.

codesandbox

Fuzzyma commented 2 years ago

Wow the usage of svg.js gets weirder every day :D. yeah there was a change in nodeOrNew to allow manipulating svgs that are loaded in an object tag. Object creates its own window (and therefore Node class) and we need to make sure that the correct one is used. Try to import the nodes into your document first: https://developer.mozilla.org/de/docs/Web/API/Document/importNode

logrox commented 2 years ago

It works, thanks.

Fuzzyma commented 2 years ago

It does? Awesome!! That was totally a shot into the blue :D