Skip to content

Commit

Permalink
dist
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Apr 7, 2021
1 parent 302a23b commit cce4ac1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions dist/fabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -11233,7 +11233,8 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
inverted: true,
dirty: true,
eraser: mergedEraserPaths
})
});
obj.freezeClipPathTransformMatrix();
},

/**
Expand All @@ -11259,7 +11260,7 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
}

var path = this.createPath(pathData);
//this.canvas.clearContext(this.canvas.contextTop);
this.canvas.clearContext(this.canvas.contextTop);
this.canvas.fire('before:path:created', { path: path });

if (this.canvas.backgroundImage && this.canvas.backgroundImage.erasable) {
Expand Down Expand Up @@ -15314,6 +15315,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
return !!this.shadow && (this.shadow.offsetX !== 0 || this.shadow.offsetY !== 0);
},

/**
* Used by @class fabric.EraserBrush to position the erased paths
*/
_clipPathTransformMatrix: null,
freezeClipPathTransformMatrix: function () {
this._clipPathTransformMatrix = this.calcTransformMatrix();
},

/**
* Execute the drawing operation for an object clipPath
* @param {CanvasRenderingContext2D} ctx Context to render on
Expand All @@ -15331,7 +15340,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
}
//ctx.scale(1 / 2, 1 / 2);
if (path.absolutePositioned) {
var m = fabric.util.invertTransform(this.calcTransformMatrix());
var m = fabric.util.invertTransform(this._clipPathTransformMatrix || this.calcTransformMatrix());
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
}
path.transform(ctx);
Expand Down
2 changes: 1 addition & 1 deletion dist/fabric.min.js

Large diffs are not rendered by default.

0 comments on commit cce4ac1

Please sign in to comment.