From 29677a572171288bbeabbf306eb0e69fa5563da4 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 2 Nov 2009 14:29:12 +0000 Subject: [PATCH] Fixed issue 300 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@894 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index a866b675..38577c57 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3508,7 +3508,8 @@ function BatchCommand(text) { } } // if child has a bbox (i.e. not a or <defs> element), then it is an orphan - else if(canvas.getBBox(child)) { + else if(canvas.getBBox(child) && child.nodeName != 'defs') { // Opera returns a BBox for defs + var bb = canvas.getBBox(child); orphans.push(child); } } @@ -5180,9 +5181,9 @@ function BatchCommand(text) { current_layer.appendChild(elem); batchCmd.addSubCommand(new InsertElementCommand(elem)); } - + if (!batchCmd.isEmpty()) { - this.addToSelection(copiedElements); + this.addToSelection(copiedElements.reverse()); // Need to reverse for correct selection-adding this.moveSelectedElements(20,20,false); addCommandToHistory(batchCmd); call("selected", selectedElements);