From: Ulrich-Matthias Schäfer Date: Wed, 23 Mar 2016 21:50:58 +0000 (+0100) Subject: fix lines function for textpath and make textpath a parent element X-Git-Tag: 2.3.0~9^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=41e6dce08645309434a81871908899b8c3b9dff8;p=svg.js.git fix lines function for textpath and make textpath a parent element --- 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