From b8fcc9b105f801ad5e84fb8a7ce52f10525600a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 3 May 2013 16:56:00 -0700 Subject: [PATCH] Simplify PathItem#exclude() and #divide() --- src/path/PathItem.Boolean.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index c6efe7d2..e4203104 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -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) {