From 6f2822fac8030f162f2fdc6dd8fa33704a4ad4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KB=20J=C3=B8rgensen?= Date: Fri, 11 Nov 2016 15:46:51 +0100 Subject: [PATCH] Removed code which went through all nodes and recalculated dimensions, which was a lot of work for large svg drawings. There's no need to do that when loading. It will happen gradually when you use it and on manageable parts. This changed the loading time for a page with svg-edit and a large drawing from ~50 secs to ~5 secs. --- editor/svgcanvas.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 754745fc..38ca1c07 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -4513,16 +4513,6 @@ this.setSvgString = function(xmlString) { convertGradients(content[0]); - // recalculate dimensions on the top-level children so that unnecessary transforms - // are removed - svgedit.utilities.walkTreePost(svgcontent, function(n) { - try { - svgedit.recalculate.recalculateDimensions(n); - } catch(e) { - console.log(e); - } - }); - var attrs = { id: 'svgcontent', overflow: curConfig.show_outside_canvas ? 'visible' : 'hidden'