mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-16 04:05:00 +00:00
Separate the Merge node from the Boolean Operation node (#1933)
* Rework boolean operation node * Set Boolean Operation name for layer * Remove memoize * Update both demo artworks that use booleans * Delete dead code, rename input connectors * Remove more dead code --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
fa981a0897
commit
33739b9ad4
13 changed files with 60 additions and 273 deletions
|
@ -16,11 +16,7 @@ export function booleanIntersect(path1: string, path2: string): string {
|
|||
return booleanOperation(path1, path2, "intersect");
|
||||
}
|
||||
|
||||
export function booleanDifference(path1: string, path2: string): string {
|
||||
return booleanOperation(path1, path2, "exclude");
|
||||
}
|
||||
|
||||
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect" | "exclude"): string {
|
||||
function booleanOperation(path1: string, path2: string, operation: "unite" | "subtract" | "intersect"): string {
|
||||
const paperPath1 = new paper.CompoundPath(path1);
|
||||
const paperPath2 = new paper.CompoundPath(path2);
|
||||
const result = paperPath1[operation](paperPath2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue