diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 13:53:14 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-08 13:53:14 +0100 |
commit | 15fd93ef07c1860fba7d7b285fe94dcb97c6f334 (patch) | |
tree | e1c0e3c46425bf22ac8bf49a48ea3cedce0dffe1 /src | |
parent | ae04f7599c822dec52af60c51aeb2ab135818c5d (diff) | |
download | svg.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.js | 6 |
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')) |