From 9fea1198179cd9e8ddd217b7b82beafe86a119fc Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Jul 2021 15:52:58 +0300 Subject: [PATCH] handle `absolutePositioned` case --- src/brushes/base_brush.class.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/brushes/base_brush.class.js b/src/brushes/base_brush.class.js index 46abc58ecfd..66b71dfd994 100644 --- a/src/brushes/base_brush.class.js +++ b/src/brushes/base_brush.class.js @@ -69,7 +69,6 @@ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype */ clipPath: undefined, - /** * Sets brush styles * @private @@ -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); },