mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Remove checks from boolean path operations
This commit is contained in:
parent
ea29e65e6b
commit
cc2e1921f9
1 changed files with 0 additions and 10 deletions
|
@ -204,8 +204,6 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
||||||
* @return {PathItem} the resulting path item
|
* @return {PathItem} the resulting path item
|
||||||
*/
|
*/
|
||||||
unite: function(path) {
|
unite: function(path) {
|
||||||
if (!path)
|
|
||||||
return this;
|
|
||||||
return computeBoolean(this, path,
|
return computeBoolean(this, path,
|
||||||
function(w) { return w === 1 || w === 0; }, false);
|
function(w) { return w === 1 || w === 0; }, false);
|
||||||
},
|
},
|
||||||
|
@ -218,8 +216,6 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
||||||
* @return {PathItem} the resulting path item
|
* @return {PathItem} the resulting path item
|
||||||
*/
|
*/
|
||||||
intersect: function(path) {
|
intersect: function(path) {
|
||||||
if (!path)
|
|
||||||
return this;
|
|
||||||
return computeBoolean(this, path,
|
return computeBoolean(this, path,
|
||||||
function(w) { return w === 2; }, false);
|
function(w) { return w === 2; }, false);
|
||||||
},
|
},
|
||||||
|
@ -232,8 +228,6 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
||||||
* @return {PathItem} the resulting path item
|
* @return {PathItem} the resulting path item
|
||||||
*/
|
*/
|
||||||
subtract: function(path) {
|
subtract: function(path) {
|
||||||
if (!path)
|
|
||||||
return this;
|
|
||||||
return computeBoolean(this, path,
|
return computeBoolean(this, path,
|
||||||
function(w) { return w === 1; }, true);
|
function(w) { return w === 1; }, true);
|
||||||
},
|
},
|
||||||
|
@ -248,8 +242,6 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
||||||
* @return {Group} the resulting group item
|
* @return {Group} the resulting group item
|
||||||
*/
|
*/
|
||||||
exclude: function(path) {
|
exclude: function(path) {
|
||||||
if (!path)
|
|
||||||
return this;
|
|
||||||
return new Group([this.subtract(path), path.subtract(this)]);
|
return new Group([this.subtract(path), path.subtract(this)]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -261,8 +253,6 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
||||||
* @return {Group} the resulting group item
|
* @return {Group} the resulting group item
|
||||||
*/
|
*/
|
||||||
divide: function(path) {
|
divide: function(path) {
|
||||||
if (!path)
|
|
||||||
return this;
|
|
||||||
return new Group([this.subtract(path), this.intersect(path)]);
|
return new Group([this.subtract(path), this.intersect(path)]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue