mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Simplify PathItem#exclude() and #divide()
This commit is contained in:
parent
c11967c81c
commit
b8fcc9b105
1 changed files with 2 additions and 8 deletions
|
@ -78,18 +78,12 @@ PathItem.inject({
|
|||
// TODO: cache the split objects and find a way to properly clone them!
|
||||
// a.k.a. eXclusiveOR
|
||||
exclude: function(path) {
|
||||
var res1 = this.subtract(path);
|
||||
var res2 = path.subtract(this);
|
||||
var res = new Group([res1, res2]);
|
||||
return res;
|
||||
return new Group([this.subtract(path), path.subtract(this)]);
|
||||
},
|
||||
|
||||
// Divide path1 by path2
|
||||
divide: function(path) {
|
||||
var res1 = this.subtract(path);
|
||||
var res2 = this.intersect(path);
|
||||
var res = new Group([res1, res2]);
|
||||
return res;
|
||||
return new Group([this.subtract(path), this.intersect(path)]);
|
||||
},
|
||||
|
||||
_splitPath: function(_ixs, other) {
|
||||
|
|
Loading…
Reference in a new issue