mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -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!
|
// TODO: cache the split objects and find a way to properly clone them!
|
||||||
// a.k.a. eXclusiveOR
|
// a.k.a. eXclusiveOR
|
||||||
exclude: function(path) {
|
exclude: function(path) {
|
||||||
var res1 = this.subtract(path);
|
return new Group([this.subtract(path), path.subtract(this)]);
|
||||||
var res2 = path.subtract(this);
|
|
||||||
var res = new Group([res1, res2]);
|
|
||||||
return res;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Divide path1 by path2
|
// Divide path1 by path2
|
||||||
divide: function(path) {
|
divide: function(path) {
|
||||||
var res1 = this.subtract(path);
|
return new Group([this.subtract(path), this.intersect(path)]);
|
||||||
var res2 = this.intersect(path);
|
|
||||||
var res = new Group([res1, res2]);
|
|
||||||
return res;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_splitPath: function(_ixs, other) {
|
_splitPath: function(_ixs, other) {
|
||||||
|
|
Loading…
Reference in a new issue