diff options
author | wout <wout@impinc.co.uk> | 2013-07-26 09:17:34 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-07-26 09:17:34 +0100 |
commit | 21d6c0b30a530ce7746f789921c7135079f43338 (patch) | |
tree | e31f12819b83222cccdaaebbb171e800e97ffff5 /src/element.js | |
parent | 0685d55d3125f212975807f540520cffb663d9a8 (diff) | |
download | svg.js-21d6c0b30a530ce7746f789921c7135079f43338.tar.gz svg.js-21d6c0b30a530ce7746f789921c7135079f43338.zip |
Added support for CommonJS and AMD, bunped to v0.300.31
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js index e6a7cd7..630b4a8 100644 --- a/src/element.js +++ b/src/element.js @@ -161,6 +161,10 @@ SVG.extend(SVG.Element, { if (SVG.Color.test(v) || SVG.Color.isRgb(v)) v = new SVG.Color(v) + /* ensure correct numeric values */ + else if (typeof v === 'number') + v = new SVG.Number(v) + /* parse array values */ else if (Array.isArray(v)) v = new SVG.Array(v) @@ -249,7 +253,7 @@ SVG.extend(SVG.Element, { /* add translation */ if (o.x != 0 || o.y != 0) - transform.push('translate(' + o.x / o.scaleX + ' ' + o.y / o.scaleY + ')') + transform.push('translate(' + new SVG.Number(o.x / o.scaleX) + ' ' + new SVG.Number(o.y / o.scaleY) + ')') /* add offset translation */ if (this._offset && this._offset.x != 0 && this._offset.y != 0) |