From b9c58d1732328e0e2a7129fd232b478f9e3e1315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 1 Mar 2013 13:29:48 -0800 Subject: [PATCH] Fix issue with text positioning. HTML ignores white space before / after content. --- src/svg/SvgImport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 442cd377..36b2711e 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -254,7 +254,7 @@ new function() { // lengthAdjust: var text = new PointText(getPoint(node, 'x', 'y', false, 0) .add(getPoint(node, 'dx', 'dy', false, 0))); - text.setContent(node.textContent || ''); + text.setContent(node.textContent.trim() || ''); return text; } }; @@ -385,7 +385,7 @@ new function() { var rect = Rectangle.create.apply(this, convertValue(value, 'array')), size = getSize(node, 'width', 'height', true); if (item instanceof Group) { - // This is either a top-level sbg node, or the container for a + // This is either a top-level svg node, or the container for a // symbol. var scale = size ? rect.getSize().divide(size) : 1, matrix = new Matrix().translate(rect.getPoint()).scale(scale);