diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/array.js | 2 | ||||
-rw-r--r-- | src/boxes.js | 2 | ||||
-rw-r--r-- | src/color.js | 2 | ||||
-rw-r--r-- | src/matrix.js | 2 | ||||
-rw-r--r-- | src/number.js | 2 | ||||
-rw-r--r-- | src/patharray.js | 2 | ||||
-rw-r--r-- | src/point.js | 2 | ||||
-rw-r--r-- | src/pointarray.js | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/src/array.js b/src/array.js index 5ce0160..ca51d8e 100644 --- a/src/array.js +++ b/src/array.js @@ -49,7 +49,7 @@ SVG.extend(SVG.Array, { // Get morphed array at given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // generate morphed array for (var i = 0, il = this.value.length, array = []; i < il; i++) { diff --git a/src/boxes.js b/src/boxes.js index de96081..f0154bd 100644 --- a/src/boxes.js +++ b/src/boxes.js @@ -74,7 +74,7 @@ SVG.Box = SVG.invent({ }, at: function (pos) { - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this return new SVG.Box( this.x + (this.destination.x - this.x) * pos diff --git a/src/color.js b/src/color.js index 22b8506..8f47f70 100644 --- a/src/color.js +++ b/src/color.js @@ -68,7 +68,7 @@ SVG.extend(SVG.Color, { // Get morphed color at given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // normalise pos pos = pos < 0 ? 0 : pos > 1 ? 1 : pos diff --git a/src/matrix.js b/src/matrix.js index 8028b15..e823a81 100644 --- a/src/matrix.js +++ b/src/matrix.js @@ -68,7 +68,7 @@ SVG.Matrix = SVG.invent({ // Get morphed matrix at a given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // calculate morphed matrix at a given position var matrix = new SVG.Matrix({ diff --git a/src/number.js b/src/number.js index ba95151..6413f94 100644 --- a/src/number.js +++ b/src/number.js @@ -91,7 +91,7 @@ SVG.Number = SVG.invent({ // Get morphed number at given position at: function (pos) { // Make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // Generate new morphed number return new SVG.Number(this.destination) diff --git a/src/patharray.js b/src/patharray.js index ca58513..d9ffecd 100644 --- a/src/patharray.js +++ b/src/patharray.js @@ -195,7 +195,7 @@ SVG.extend(SVG.PathArray, { // Get morphed path array at given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this var sourceArray = this.value var destinationArray = this.destination.value diff --git a/src/point.js b/src/point.js index 72a9572..682092e 100644 --- a/src/point.js +++ b/src/point.js @@ -32,7 +32,7 @@ SVG.Point = SVG.invent({ // Get morphed point at a given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // calculate morphed matrix at a given position var point = new SVG.Point({ diff --git a/src/pointarray.js b/src/pointarray.js index 6229e2e..ecf5c40 100644 --- a/src/pointarray.js +++ b/src/pointarray.js @@ -32,7 +32,7 @@ SVG.extend(SVG.PointArray, { // Get morphed array at given position at: function (pos) { // make sure a destination is defined - if (!this.destination) throw new Error('No destination set') + if (!this.destination) return this // generate morphed point string for (var i = 0, il = this.value.length, array = []; i < il; i++) { |