aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-23 22:50:58 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-23 22:50:58 +0100
commit41e6dce08645309434a81871908899b8c3b9dff8 (patch)
tree793b01f8646296d0e40fe95fc16f9bbec93e763f /src
parent8205de6087bd6fe48706f598c49a111f52740c97 (diff)
downloadsvg.js-41e6dce08645309434a81871908899b8c3b9dff8.tar.gz
svg.js-41e6dce08645309434a81871908899b8c3b9dff8.zip
fix lines function for textpath and make textpath a parent element
Diffstat (limited to 'src')
-rw-r--r--src/text.js4
-rw-r--r--src/textpath.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/text.js b/src/text.js
index debc1fb..6dd4dee 100644
--- a/src/text.js
+++ b/src/text.js
@@ -112,8 +112,10 @@ SVG.Text = SVG.invent({
}
// Get all the first level lines
, lines: function() {
+ var node = (this.textPath && this.textPath() || this).node
+
// filter tspans and map them to SVG.js instances
- var lines = SVG.utils.map(SVG.utils.filterSVGElements(this.node.childNodes), function(el){
+ var lines = SVG.utils.map(SVG.utils.filterSVGElements(node.childNodes), function(el){
return SVG.adopt(el)
})
diff --git a/src/textpath.js b/src/textpath.js
index 03dfbee..f091de9 100644
--- a/src/textpath.js
+++ b/src/textpath.js
@@ -3,7 +3,7 @@ SVG.TextPath = SVG.invent({
create: 'textPath'
// Inherit from
-, inherit: SVG.Element
+, inherit: SVG.Parent
// Define parent class
, parent: SVG.Text