Fix multi-subpath boolean operations (#1804)

Fix multi subpath boolean operations
This commit is contained in:
James Lindsay 2024-07-06 09:26:00 +01:00 committed by GitHub
parent 621f469a15
commit 7a82a75d2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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();