diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-06 22:28:20 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-06 22:28:20 +0100 |
commit | 3cb00000586340276998144d202d7af35c47ae36 (patch) | |
tree | 6b431cf16f05efeef63e145d1d1dc6aaceede4fb /src/array.js | |
parent | 2702ceb26d3021720f3ff979bcf5f46fc65699e9 (diff) | |
download | svg.js-3cb00000586340276998144d202d7af35c47ae36.tar.gz svg.js-3cb00000586340276998144d202d7af35c47ae36.zip |
tab to space, block comments to line comments
Diffstat (limited to 'src/array.js')
-rw-r--r-- | src/array.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/array.js b/src/array.js index 1913cc5..8f47774 100644 --- a/src/array.js +++ b/src/array.js @@ -2,11 +2,11 @@ SVG.Array = function(array, fallback) { array = (array || []).valueOf() - /* if array is empty and fallback is provided, use fallback */ + // if array is empty and fallback is provided, use fallback if (array.length == 0 && fallback) array = fallback.valueOf() - /* parse array */ + // parse array this.value = this.parse(array) } @@ -15,7 +15,7 @@ SVG.extend(SVG.Array, { morph: function(array) { this.destination = this.parse(array) - /* normalize length of arrays */ + // normalize length of arrays if (this.value.length != this.destination.length) { var lastValue = this.value[this.value.length - 1] , lastDestination = this.destination[this.destination.length - 1] @@ -30,20 +30,20 @@ SVG.extend(SVG.Array, { } // Clean up any duplicate points , settle: function() { - /* find all unique values */ + // find all unique values for (var i = 0, il = this.value.length, seen = []; i < il; i++) if (seen.indexOf(this.value[i]) == -1) seen.push(this.value[i]) - /* set new value */ + // set new value return this.value = seen } // Get morphed array at given position , at: function(pos) { - /* make sure a destination is defined */ + // make sure a destination is defined if (!this.destination) return this - /* generate morphed array */ + // generate morphed array for (var i = 0, il = this.value.length, array = []; i < il; i++) array.push(this.value[i] + (this.destination[i] - this.value[i]) * pos) @@ -61,7 +61,7 @@ SVG.extend(SVG.Array, { , parse: function(array) { array = array.valueOf() - /* if already is an array, no need to parse it */ + // if already is an array, no need to parse it if (Array.isArray(array)) return array return this.split(array) |