summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 13:53:14 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-11-08 13:53:14 +0100
commit15fd93ef07c1860fba7d7b285fe94dcb97c6f334 (patch)
treee1c0e3c46425bf22ac8bf49a48ea3cedce0dffe1 /src
parentae04f7599c822dec52af60c51aeb2ab135818c5d (diff)
downloadsvg.js-15fd93ef07c1860fba7d7b285fe94dcb97c6f334.tar.gz
svg.js-15fd93ef07c1860fba7d7b285fe94dcb97c6f334.zip
`SVG.Text.rebuild()` now takes every font-size into account (#512)
Diffstat (limited to 'src')
-rw-r--r--src/elements/Text.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/elements/Text.js b/src/elements/Text.js
index f1aa402..f221004 100644
--- a/src/elements/Text.js
+++ b/src/elements/Text.js
@@ -122,9 +122,13 @@ export default class Text extends Shape {
if (this._rebuild) {
var self = this
var blankLineOffset = 0
- var dy = this.dom.leading * new SVGNumber(this.attr('font-size'))
+ var leading = this.dom.leading
this.each(function () {
+ var fontSize = window.getComputedStyle(this.node)
+ .getPropertyValue('font-size')
+ var dy = leading * new SVGNumber(fontSize)
+
if (this.dom.newLined) {
this.attr('x', self.attr('x'))