Skip to content

Commit

Permalink
use sendObjectToPlane
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Sep 3, 2022
1 parent cd54755 commit 5ce2a09
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/util/misc/mergeClipPaths.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5ce2a09

Please sign in to comment.