From 576f76e6711df9c1cd33945f5638b8a608863f41 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 23 Aug 2010 13:58:51 +0000 Subject: [PATCH] Fixed bug where matrix transform was left on right-clicked elements, and one where imported SVGs had the same ID as their use elems git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1677 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 4e7373df..3df23e34 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -4276,13 +4276,15 @@ var getMouseTarget = this.getMouseTarget = function(evt) { pathActions.clear(); } // else if it's a path, go into pathedit mode in mouseup - - // insert a dummy transform so if the element(s) are moved it will have - // a transform to use for its translate - for (var i = 0; i < selectedElements.length; ++i) { - if(selectedElements[i] == null) continue; - var slist = getTransformList(selectedElements[i]); - slist.insertItemBefore(svgroot.createSVGTransform(), 0); + + if(!right_click) { + // insert a dummy transform so if the element(s) are moved it will have + // a transform to use for its translate + for (var i = 0; i < selectedElements.length; ++i) { + if(selectedElements[i] == null) continue; + var slist = getTransformList(selectedElements[i]); + slist.insertItemBefore(svgroot.createSVGTransform(), 0); + } } } else if(!right_click){ @@ -8237,10 +8239,10 @@ this.importSvgString = function(xmlString) { symbol.id = getNextId(); var use_el = svgdoc.createElementNS(svgns, "use"); - use_el.id = getNextId(); setHref(use_el, "#" + symbol.id); findDefs().appendChild(symbol); current_layer.appendChild(use_el); + use_el.id = getNextId(); clearSelection(); use_el.setAttribute("transform", ts);