diff options
author | wout <wout@impinc.co.uk> | 2013-06-23 14:59:46 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-06-23 14:59:46 +0100 |
commit | a72b8a7afb609b9a76c494d9123d78e5c40962bf (patch) | |
tree | fdaacf9d56a3cc9e935ab1a5dcb4ad0458f929e4 /src/element.js | |
parent | 5e52bd4f9f309b20bc848d5d45e5e620b17c1ad7 (diff) | |
download | svg.js-a72b8a7afb609b9a76c494d9123d78e5c40962bf.tar.gz svg.js-a72b8a7afb609b9a76c494d9123d78e5c40962bf.zip |
Added SVG.Number, reworked gradient system
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/element.js b/src/element.js index 3fa456f..d40108d 100644 --- a/src/element.js +++ b/src/element.js @@ -23,12 +23,18 @@ SVG.Element = function(node) { SVG.extend(SVG.Element, { // Move over x-axis x: function(x) { - if (x) x /= this.trans.scaleX + if (x) { + x = new SVG.Number(x) + x.value /= this.trans.scaleX + } return this.attr('x', x) } // Move over y-axis , y: function(y) { - if (y) y /= this.trans.scaleY + if (y) { + y = new SVG.Number(y) + y.value /= this.trans.scaleY + } return this.attr('y', y) } // Move by center over x-axis @@ -50,8 +56,8 @@ SVG.extend(SVG.Element, { // Set element size to given width and height , size: function(width, height) { return this.attr({ - width: width - , height: height + width: new SVG.Number(width) + , height: new SVG.Number(height) }) } // Clone element |