Skip to content

Commit

Permalink
fix(fabric.Path): setting path during runtime (fabricjs#7141)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 authored and rockerBOO committed May 2, 2022
1 parent 5d6e8b2 commit 769a37a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shapes/path.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
max = fabric.util.array.max,
extend = fabric.util.object.extend,
clone = fabric.util.object.clone,
_toString = Object.prototype.toString,
toFixed = fabric.util.toFixed;

if (fabric.Path) {
Expand Down Expand Up @@ -60,6 +61,7 @@
* @param {Object} [options] Options object
*/
_setPath: function (path, options) {
var fromArray = _toString.call(path) === '[object Array]';
this.path = fabric.util.makePathSimpler(
Array.isArray(path) ? path : fabric.util.parsePath(path)
);
Expand Down

0 comments on commit 769a37a

Please sign in to comment.