diff options
author | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-12-23 15:19:20 -0500 |
---|---|---|
committer | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-12-23 15:27:38 -0500 |
commit | c8afde0760979d9ef9e9edc4f703c678419a2ee8 (patch) | |
tree | 346b241370713da4db9d3d1a37e6e6505038122c /src | |
parent | 80acdb3d77aa228071a54de806a614ebf50fe49e (diff) | |
download | svg.js-c8afde0760979d9ef9e9edc4f703c678419a2ee8.tar.gz svg.js-c8afde0760979d9ef9e9edc4f703c678419a2ee8.zip |
Make some fixes in SVG.PathArray
Rename the method haveSameCommands to equalCommands and
replace undefined by null.
Diffstat (limited to 'src')
-rw-r--r-- | src/patharray.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/patharray.js b/src/patharray.js index 3077a95..479c66f 100644 --- a/src/patharray.js +++ b/src/patharray.js @@ -100,27 +100,27 @@ SVG.extend(SVG.PathArray, { return this } - // Test if the passed path array use the same commands as this path array -, haveSameCommands: function(pathArray) { - var i, il, haveSameCommands + // Test if the passed path array use the same path data commands as this path array +, equalCommands: function(pathArray) { + var i, il, equalCommands pathArray = new SVG.PathArray(pathArray) - haveSameCommands = this.value.length === pathArray.value.length - for(i = 0, il = this.value.length; haveSameCommands && i < il; i++) { - haveSameCommands = this.value[i][0] === pathArray.value[i][0] + equalCommands = this.value.length === pathArray.value.length + for(i = 0, il = this.value.length; equalCommands && i < il; i++) { + equalCommands = this.value[i][0] === pathArray.value[i][0] } - return haveSameCommands + return equalCommands } // Make path array morphable , morph: function(pathArray) { pathArray = new SVG.PathArray(pathArray) - if(this.haveSameCommands(pathArray)) { + if(this.equalCommands(pathArray)) { this.destination = pathArray } else { - this.destination = undefined + this.destination = null } return this |