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) {