mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Boolean -fix: Correctly perform boolean operations regardless of the input paths' winding direction
This commit is contained in:
parent
669fb1638a
commit
4f54ac1f4c
1 changed files with 6 additions and 4 deletions
|
@ -113,10 +113,12 @@ PathItem.inject(new function() {
|
|||
// result of that on to the second call.
|
||||
splitPath(splitPath(intersections, true));
|
||||
// Do operator specific calculations before we begin
|
||||
if (subtract) {
|
||||
path2.reverse();
|
||||
path2Clockwise = !path2Clockwise;
|
||||
}
|
||||
// Make both paths at clockwise orientation, except when @subtract = true
|
||||
// We need both paths at opposit orientation for subtraction
|
||||
!path1Clockwise && path1.reverse();
|
||||
!(subtract ^ path2Clockwise) && path2.reverse();
|
||||
path1Clockwise = true;
|
||||
path2Clockwise = !subtract;
|
||||
var paths = []
|
||||
.concat(path1._children || [path1])
|
||||
.concat(path2._children || [path2]),
|
||||
|
|
Loading…
Reference in a new issue