Skip to content

Commit

Permalink
handle absolutePositioned case
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Jul 1, 2021
1 parent 2640b2e commit 9fea119
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/brushes/base_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype
*/
clipPath: undefined,


/**
* Sets brush styles
* @private
Expand Down Expand Up @@ -130,6 +129,12 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype
* @param {CanvasRenderingContext2D} ctx
*/
drawClipPathOnCache: function (ctx) {
if (this.clipPath && this.clipPath.absolutePositioned) {
// we remove `absolutePositioned`
// because it has no effect (the brush has no transform)
// and it will try to call `calcTransformMatrix` which will throw an error
delete this.clipPath.absolutePositioned;
}
fabric.Object.prototype.drawClipPathOnCache.call(this, ctx);
},

Expand Down

0 comments on commit 9fea119

Please sign in to comment.