summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-04-12 13:16:21 +0100
committerwout <wout@impinc.co.uk>2013-04-12 13:16:21 +0100
commit9aa9472043fa53ce11f716537a4e1eded464cc97 (patch)
tree388f36a1220ecb655bf7447253ee1b46dea77c46 /src/element.js
parentec833bcefe20bd51d128cd0978128a9c9a63a043 (diff)
downloadsvg.js-9aa9472043fa53ce11f716537a4e1eded464cc97.tar.gz
svg.js-9aa9472043fa53ce11f716537a4e1eded464cc97.zip
Bumped to v0.13
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/element.js b/src/element.js
index bad57fa..b069d3a 100644
--- a/src/element.js
+++ b/src/element.js
@@ -178,7 +178,11 @@ SVG.extend(SVG.Element, {
}
// Manage transformations
, transform: function(o, v) {
- if (typeof o === 'string') {
+ if (arguments.length == 0) {
+ /* act as a getter if no argument is given */
+ return this.trans
+
+ } else if (typeof o === 'string') {
/* act as a getter if only one string argument is given */
if (arguments.length < 2)
return this.trans[o]
@@ -245,9 +249,8 @@ SVG.extend(SVG.Element, {
if (this._offset)
transform.push('translate(' + (-this._offset.x) + ',' + (-this._offset.y) + ')')
- /* add only te required transformations */
- if (transform.length > 0)
- this.node.setAttribute('transform', transform.join(' '))
+ /* update transformations, even if there are none */
+ this.node.setAttribute('transform', transform.join(' '))
return this
}