aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-12-04 18:05:22 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-12-04 18:05:22 +0100
commit3a6fe31f702078cee66118e2cb1b37d4e03c93e1 (patch)
tree461972e76f17b4e50a0c641937b7196575b1004f /src
parente58ec6ae92c976b674d66943211f31d08f57ea46 (diff)
downloadsvg.js-3a6fe31f702078cee66118e2cb1b37d4e03c93e1.tar.gz
svg.js-3a6fe31f702078cee66118e2cb1b37d4e03c93e1.zip
transform() returnw a-f now, too, double newlines create blank lines
Diffstat (limited to 'src')
-rw-r--r--src/matrix.js6
-rw-r--r--src/text.js11
2 files changed, 15 insertions, 2 deletions
diff --git a/src/matrix.js b/src/matrix.js
index 9160502..4358e55 100644
--- a/src/matrix.js
+++ b/src/matrix.js
@@ -40,6 +40,12 @@ SVG.Matrix = SVG.invent({
, scaleY: Math.sqrt(this.c * this.c + this.d * this.d)
// rotation
, rotation: skewX
+ , a: this.a
+ , b: this.b
+ , c: this.c
+ , d: this.d
+ , e: this.e
+ , f: this.f
}
}
// Clone matrix
diff --git a/src/text.js b/src/text.js
index 9fb8fe3..79a4e1e 100644
--- a/src/text.js
+++ b/src/text.js
@@ -129,13 +129,20 @@ SVG.Text = SVG.invent({
// define position of all lines
if (this._rebuild) {
var self = this
-
+ , blankLineOffset = 0
+ , dy = this.dom.leading * new SVG.Number(this.attr('font-size'))
+
this.lines().each(function() {
if (this.dom.newLined) {
if (!this.textPath)
this.attr('x', self.attr('x'))
- this.attr('dy', self.dom.leading * new SVG.Number(self.attr('font-size')))
+ if(this.text() == '\n') {
+ blankLineOffset += dy
+ }else{
+ this.attr('dy', dy + blankLineOffset)
+ blankLineOffset = 0
+ }
}
})