diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2019-01-12 20:32:39 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2019-01-12 20:32:39 +0100 |
commit | 60792807eee29f1b748c9b12d308c477f7c1227d (patch) | |
tree | 27f5c46c02ea0acbec71668935ef72cf2749698e /src/elements/Tspan.js | |
parent | f5eff8745af43fcfcc2e837d89d549cb66220d99 (diff) | |
download | svg.js-60792807eee29f1b748c9b12d308c477f7c1227d.tar.gz svg.js-60792807eee29f1b748c9b12d308c477f7c1227d.zip |
Fix move and size of groups, removed setting of a default font so we dont act against user intention, fixed bug in `font()`
Diffstat (limited to 'src/elements/Tspan.js')
-rw-r--r-- | src/elements/Tspan.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/elements/Tspan.js b/src/elements/Tspan.js index abd032f..64895fc 100644 --- a/src/elements/Tspan.js +++ b/src/elements/Tspan.js @@ -4,7 +4,9 @@ import { register, wrapWithAttrCheck } from '../utils/adopter.js' +import { globals } from '../utils/window.js' import { registerMethods } from '../utils/methods.js' +import SVGNumber from '../types/SVGNumber.js' import Text from './Text.js' import * as textable from '../modules/core/textable.js' @@ -41,8 +43,12 @@ export default class Tspan extends Text { // mark new line this.dom.newLined = true + var fontSize = globals.window.getComputedStyle(this.node) + .getPropertyValue('font-size') + var dy = t.dom.leading * new SVGNumber(fontSize) + // apply new position - return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x()) + return this.dy(dy).attr('x', t.x()) } } |