From 6efc057a5a521d193eb45e621a973e94ee3c9671 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 21 Oct 2009 18:47:23 +0000 Subject: [PATCH] Fixed issues 282 and 283 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@863 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 464c2125..41507ceb 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -4334,8 +4334,9 @@ function BatchCommand(text) { var clone = elem.cloneNode(true) elem.parentNode.insertBefore(clone, elem); elem.parentNode.removeChild(elem); - canvas.clearSelection(); - canvas.addToSelection([clone],true); + selectorManager.releaseSelector(elem); + selectedElements[0] = clone; + selectorManager.requestSelector(clone).showGrips(true); return clone; } @@ -4406,7 +4407,7 @@ function BatchCommand(text) { } // Timeout needed for Opera & Firefox setTimeout(function() { - selectorManager.requestSelector(elem).resize(selectedBBoxes[i]); + selectorManager.requestSelector(elem).resize(elem.getBBox()); },0); // if this element was rotated, and we changed the position of this element // we need to update the rotational transform attribute @@ -4422,7 +4423,9 @@ function BatchCommand(text) { } // if oldValue != newValue } // for each elem svgroot.unsuspendRedraw(handle); - call("changed", elems); + + // Calling changed here will cause the toolbar to be updated too many times +// call("changed", elems); }; // This function returns a BatchCommand object which summarizes the