summaryrefslogtreecommitdiffstats
path: root/src/sugar.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-03-09 22:28:47 +0100
committerwout <wout@impinc.co.uk>2013-03-09 22:28:47 +0100
commit6c6c82ed59533f44f8754b69d47e3b11cd6dd129 (patch)
treeadaef53d8970acb228fe14d490c532f1baabbb13 /src/sugar.js
parent16c4a146ee97fa43e0c456fe801490351e551e96 (diff)
downloadsvg.js-6c6c82ed59533f44f8754b69d47e3b11cd6dd129.tar.gz
svg.js-6c6c82ed59533f44f8754b69d47e3b11cd6dd129.zip
Bumped to v0.9, added better style management, text support and extended animation functionality0.10
Diffstat (limited to 'src/sugar.js')
-rw-r--r--src/sugar.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/sugar.js b/src/sugar.js
index 14868e3..1f7339a 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -63,23 +63,19 @@ SVG.extend(SVG.Element, SVG.FX, {
if (SVG.Text) {
- SVG.extend(SVG.Text, {
+ SVG.extend(SVG.Text, SVG.FX, {
// Set font
font: function(o) {
- var key, attr = {}
-
- for (key in o)
- key == 'leading' ?
- attr[key] = o[key] :
+ for (var key in o)
key == 'anchor' ?
- attr['text-anchor'] = o[key] :
+ this.attr('text-anchor', o[key]) :
_styleAttr.indexOf(key) > -1 ?
- attr['font-'+ key] = o[key] :
- void 0
-
- return this.attr(attr).text(this.content)
+ this.attr('font-'+ key, o[key]) :
+ this.attr(key, o[key])
+
+ return this
}
-
+
})
}