aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-04-14 17:21:42 +0100
committerwout <wout@impinc.co.uk>2013-04-14 17:21:42 +0100
commit801a9e1bfb6ff2fb31d00f9bc71b9af1175395bb (patch)
treea1b0fa180ae0752cb8f0dc7b69aab693e5708617 /src
parent874a935d7bff9647d7e459dc18e0dce2996d0455 (diff)
downloadsvg.js-801a9e1bfb6ff2fb31d00f9bc71b9af1175395bb.tar.gz
svg.js-801a9e1bfb6ff2fb31d00f9bc71b9af1175395bb.zip
Fix in defaults
Diffstat (limited to 'src')
-rw-r--r--src/default.js26
-rw-r--r--src/element.js5
2 files changed, 17 insertions, 14 deletions
diff --git a/src/default.js b/src/default.js
index 1dbe9c0..314961d 100644
--- a/src/default.js
+++ b/src/default.js
@@ -9,23 +9,23 @@ SVG.defaults = {
'fill-opacity': 1
, 'stroke-opacity': 1
, 'stroke-width': 0
- , fill: '#000'
- , stroke: '#000'
- , opacity: 1
+ , fill: '#000'
+ , stroke: '#000'
+ , opacity: 1
/* position */
- , x: 0
- , y: 0
- , cx: 0
- , cy: 0
+ , x: 0
+ , y: 0
+ , cx: 0
+ , cy: 0
/* size */
- , width: 0
- , height: 0
+ , width: 0
+ , height: 0
/* radius */
- , r: 0
- , rx: 0
- , ry: 0
+ , r: 0
+ , rx: 0
+ , ry: 0
/* gradient */
- , offset: 0
+ , offset: 0
}
// Default transformation values
diff --git a/src/element.js b/src/element.js
index fcf8f3c..efcd2e3 100644
--- a/src/element.js
+++ b/src/element.js
@@ -254,7 +254,10 @@ SVG.extend(SVG.Element, {
transform.push('translate(' + (-this._offset.x) + ',' + (-this._offset.y) + ')')
/* update transformations, even if there are none */
- this.node.setAttribute('transform', transform.join(' '))
+ if (transform.length == 0)
+ this.node.removeAttribute('transform')
+ else
+ this.node.setAttribute('transform', transform.join(' '))
return this
}