diff options
author | wout <wout@impinc.co.uk> | 2014-09-03 15:39:47 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-09-03 15:39:47 +0200 |
commit | 2649e3153e82f840365ce26564be96e0385199ce (patch) | |
tree | 0b3657a2ada0887e9bb0945e4d703abbf63200eb /src | |
parent | 17e15d57d8eb2cb20cc72abcf1bd5bb1bbd39e49 (diff) | |
download | svg.js-2649e3153e82f840365ce26564be96e0385199ce.tar.gz svg.js-2649e3153e82f840365ce26564be96e0385199ce.zip |
Fix in SVG.Number
Diffstat (limited to 'src')
-rwxr-xr-x | src/number.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/number.js b/src/number.js index ace511c..0ca8831 100755 --- a/src/number.js +++ b/src/number.js @@ -30,7 +30,7 @@ SVG.Number = SVG.invent({ } else { if (value instanceof SVG.Number) { - this.value = value.value + this.value = value.valueOf() this.unit = value.unit } } @@ -70,10 +70,12 @@ SVG.Number = SVG.invent({ } // Convert to different unit , to: function(unit) { + var number = new SVG.Number(this) + if (typeof unit === 'string') - this.unit = unit + number.unit = unit - return this + return number } // Make number morphable , morph: function(number) { |