diff options
author | wout <wout@impinc.co.uk> | 2013-03-09 22:28:47 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-03-09 22:28:47 +0100 |
commit | 6c6c82ed59533f44f8754b69d47e3b11cd6dd129 (patch) | |
tree | adaef53d8970acb228fe14d490c532f1baabbb13 /src/sugar.js | |
parent | 16c4a146ee97fa43e0c456fe801490351e551e96 (diff) | |
download | svg.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.js | 20 |
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 } - + }) } |