plugins/raphael.export.js
authorEdward <edward@roojs.com>
Wed, 9 Jan 2019 08:49:43 +0000 (16:49 +0800)
committerEdward <edward@roojs.com>
Wed, 9 Jan 2019 08:49:43 +0000 (16:49 +0800)
plugins/raphael.export.js

index ef5bb7d..75a4988 100644 (file)
             Roo.log(node.attrs['text']);
             Roo.log(node.attrs['text'].split('\n'));
             
-            map(node.attrs['text'].split('\n'), function (text, line, iterable) {
-                Roo.log([text, iterable, line]);
-                Roo.log([style.font.size, line + 1, node.attrs['text'].split('\n').length]);
+            var textArray = node.attrs['text'].split('\n');
+            
+            textArray.forEach((v,k) => {
                 content.push(tag('tspan',
                     {
                         x: node.attrs.x,
-                        dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
+                        dy: computeTSpanDy(style.font.size, k + 1, textArray.length)
                     },
                     null,
-                    escapeXML(text)
+                    escapeXML(v)
                 ))
+                
             });
             
             Roo.log(content);