From f9b4b0a647a0d4e4b7c175bd207c53b5e4e6cbaf Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Tue, 3 Nov 2009 14:27:33 +0000 Subject: [PATCH] Small fix to allow moving of multiple elements git-svn-id: http://svg-edit.googlecode.com/svn/branches/transformlist@899 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 77064c1d..e2d69c26 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2422,10 +2422,14 @@ function BatchCommand(text) { // update the dummy transform in our transform list // to be a translate - var tlist = canvas.getTransformList(selected); var xform = svgroot.createSVGTransform(); + var tlist = canvas.getTransformList(selected); xform.setTranslate(dx,dy); - tlist.replaceItem(xform, 0); + if(tlist.numberOfItems) { + tlist.replaceItem(xform, 0); + } else { + tlist.appendItem(xform); + } // update our internal bbox that we're tracking while dragging selectorManager.requestSelector(selected).resize(box);