svg.topath.js icon indicating copy to clipboard operation
svg.topath.js copied to clipboard

toPath method not working for Rectangle. Passed attribut invalid

Open Shadoworker opened this issue 4 years ago • 1 comments

curve.js:40793 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '0' is not a valid attribute name.

Shadoworker avatar Jun 12 '21 15:06 Shadoworker

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");

Shadoworker avatar Jun 12 '21 15:06 Shadoworker