diff options
author | wout <wout@impinc.co.uk> | 2012-12-21 21:01:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-21 21:01:03 +0100 |
commit | cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff (patch) | |
tree | 222e58dd0bb2729b237dafd22ba7077456c2b003 /src/text.js | |
parent | 9dd851e68a3241883dea7236da48d4878b1b1899 (diff) | |
download | svg.js-cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff.tar.gz svg.js-cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff.zip |
Making the svg function global
Diffstat (limited to 'src/text.js')
-rw-r--r-- | src/text.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/text.js b/src/text.js index e102360..7528c27 100644 --- a/src/text.js +++ b/src/text.js @@ -17,7 +17,8 @@ SVG.extend(SVG.Text, { this.content = t = t || 'text'; this.lines = []; - var i, s, + var i, n, + s = this._style(), p = this.parentDoc(), a = t.split("\n"); @@ -25,19 +26,19 @@ SVG.extend(SVG.Text, { this.node.removeChild(this.node.lastChild); for (i = 0, l = a.length; i < l; i++) { - s = new TSpan(). + n = new TSpan(). text(a[i]). attr({ dy: this.style['font-size'] * this.leading, x: (this.attr('x') || 0), - style: this._style() + style: s }); - this.node.appendChild(s.node); - this.lines.push(s); + this.node.appendChild(n.node); + this.lines.push(n); }; - return this; + return this.attr('style', s); }, _style: function() { |