From 5ce2a09657e5a81e772a7de165ccd3f5019692ff Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Sat, 3 Sep 2022 17:15:27 +0300 Subject: [PATCH] use `sendObjectToPlane` --- src/util/misc/mergeClipPaths.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/misc/mergeClipPaths.ts b/src/util/misc/mergeClipPaths.ts index 3cee36fa365..77b8081f453 100644 --- a/src/util/misc/mergeClipPaths.ts +++ b/src/util/misc/mergeClipPaths.ts @@ -1,6 +1,7 @@ import { fabric } from '../../../HEADER'; import { applyTransformToObject } from './objectTransforms'; import { multiplyTransformMatrices, invertTransform } from './matrix'; +import { sendObjectToPlane } from './planeChange'; /** * Merges 2 clip paths into one visually equal clip path * @@ -28,13 +29,7 @@ export const mergeClipPaths = (c1: any, c2: any) => { b = c1; } // `b` becomes `a`'s clip path so we transform `b` to `a` coordinate plane - applyTransformToObject( - b, - multiplyTransformMatrices( - invertTransform(a.calcTransformMatrix()), - b.calcTransformMatrix() - ) - ); + sendObjectToPlane(b, b.group?.calcTransformMatrix(), a.calcTransformMatrix()); // assign the `inverted` prop to the wrapping group const inverted = a.inverted && b.inverted; if (inverted) {