Fix multi-subpath boolean operations (#1804)
Fix multi subpath boolean operations
This commit is contained in:
parent
621f469a15
commit
7a82a75d2c
|
|
@ -25,8 +25,8 @@ export function booleanDivide(path1: string, path2: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect" | "exclude"): string {
|
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect" | "exclude"): string {
|
||||||
const paperPath1 = new paper.Path(path1);
|
const paperPath1 = new paper.CompoundPath(path1);
|
||||||
const paperPath2 = new paper.Path(path2);
|
const paperPath2 = new paper.CompoundPath(path2);
|
||||||
const result = paperPath1[operation](paperPath2);
|
const result = paperPath1[operation](paperPath2);
|
||||||
paperPath1.remove();
|
paperPath1.remove();
|
||||||
paperPath2.remove();
|
paperPath2.remove();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue