From 41e6dce08645309434a81871908899b8c3b9dff8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulrich-Matthias=20Sch=C3=A4fer?= Date: Wed, 23 Mar 2016 22:50:58 +0100 Subject: [PATCH] fix lines function for textpath and make textpath a parent element --- src/text.js | 4 +++- src/textpath.js | 2 +- 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 -- 2.39.5