svg.topath.js
svg.topath.js copied to clipboard
toPath method not working for Rectangle. Passed attribut invalid
curve.js:40793 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '0' is not a valid attribute name.
Solution 1
Replace in toPath() method
// let {
// width: w,
// height: h,
// rx,
// ry,
// x,
// y
// } = this.attr(['width', 'height', 'rx', 'ry', 'x', 'y'])
let w = this.attr("width");
let h = this.attr("height");
let rx = this.attr("rx");
let ry = this.attr("ry");
let x = this.attr("x");
let y = this.attr("y");