mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Merge branch 'refs/heads/master' into boolean-operations
This commit is contained in:
commit
8928eaffd0
2 changed files with 6 additions and 9 deletions
|
@ -26,18 +26,18 @@
|
|||
var inner = new Path.Circle({
|
||||
center: view.center,
|
||||
radius: 100,
|
||||
insert: false
|
||||
parent: originals,
|
||||
fillColor: 'white'
|
||||
});
|
||||
|
||||
var outer = new Path.Circle({
|
||||
center: view.center,
|
||||
radius: 140,
|
||||
insert: false
|
||||
parent: originals,
|
||||
fillColor: 'white'
|
||||
});
|
||||
|
||||
var ring = outer.subtract(inner);
|
||||
ring.parent = originals;
|
||||
ring.fillColor = 'white';
|
||||
|
||||
var operations = ['unite', 'intersect', 'subtract', 'exclude', 'divide'];
|
||||
var colors = ['red', 'green', 'blue', 'black'];
|
||||
|
|
|
@ -169,12 +169,9 @@ PathItem.inject(new function() {
|
|||
chain[j].segment._winding = winding;
|
||||
}
|
||||
// Trace closed contours and insert them into the result.
|
||||
var result = new CompoundPath();
|
||||
var result = new CompoundPath(Item.NO_INSERT);
|
||||
result.insertAbove(path1);
|
||||
result.addChildren(tracePaths(segments, operator), true);
|
||||
// Delete the proxies
|
||||
_path1.remove();
|
||||
if (_path2)
|
||||
_path2.remove();
|
||||
// See if the CompoundPath can be reduced to just a simple Path.
|
||||
result = result.reduce();
|
||||
// Copy over the left-hand item's style and we're done.
|
||||
|
|
Loading…
Reference in a new issue