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

index 8dec611..0ccb634 100644 (file)
             var tags = new Array;
             
             var text = node.attrs['text'].split('\n');
-            Roo.log(text);
-            map(node.attrs['text'].split('\n'), function (text, iterable, line) {
-                line = line || 0;
-                tags.push(tag(
-                        'text',
-                        reduce(
-                                node.attrs,
-                                function (initial, value, name) {
-                                    if (name !== 'text' && name !== 'w' && name !== 'h') {
-                                        if (name === 'font-size')
-                                            value = value + 'px';
-
-                                        initial[name] = escapeXML(value.toString());
-                                    }
-
-                                    return initial;
-                                },
-                                {
-                                    style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
-                                            styleToString(style) + ';'
-                                }
-                        ),
-                        node.matrix,
-                        tag('tspan',
-                                {
-                                    dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
-                                },
-                                null,
-                                escapeXML(text)
-                                )
-                        ));
-            });
+            
+            tags.push(tag(
+                'text',
+                reduce(
+                    node.attrs,
+                    function (initial, value, name) {
+                        if (name !== 'text' && name !== 'w' && name !== 'h') {
+                            if (name === 'font-size')
+                                value = value + 'px';
+
+                            initial[name] = escapeXML(value.toString());
+                        }
+
+                        return initial;
+                    },
+                    {
+                        style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
+                                styleToString(style) + ';'
+                    }
+                ),
+                node.matrix,
+                tag('tspan',
+                    {
+                        dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
+                    },
+                    null,
+                    escapeXML(text)
+                )
+            ));
+            
+//            map(node.attrs['text'].split('\n'), function (text, iterable, line) {
+//                line = line || 0;
+//                tags.push(tag(
+//                        'text',
+//                        reduce(
+//                                node.attrs,
+//                                function (initial, value, name) {
+//                                    if (name !== 'text' && name !== 'w' && name !== 'h') {
+//                                        if (name === 'font-size')
+//                                            value = value + 'px';
+//
+//                                        initial[name] = escapeXML(value.toString());
+//                                    }
+//
+//                                    return initial;
+//                                },
+//                                {
+//                                    style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor + ';') : 'middle;') +
+//                                            styleToString(style) + ';'
+//                                }
+//                        ),
+//                        node.matrix,
+//                        tag('tspan',
+//                                {
+//                                    dy: computeTSpanDy(style.font.size, line + 1, node.attrs['text'].split('\n').length)
+//                                },
+//                                null,
+//                                escapeXML(text)
+//                                )
+//                        ));
+//            });
 
             return tags;
         },