From 89a918a4f0551132c8e8a6788c556bab00c8ae1c Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 8 Oct 2010 19:38:40 +0000 Subject: [PATCH] Fixed bug in last checkin git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1789 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 353032d7..f2b34de8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3008,7 +3008,8 @@ var remapElement = this.remapElement = function(selected,changes,m) { } box = getBBox(selected); - if(selected.tagName === "g" || selected.tagName === "text") { + var elName = selected.tagName; + if(elName === "g" || elName === "text") { // if it was a translate, then just update x,y if (m.a == 1 && m.b == 0 && m.c == 0 && m.d == 1 && (m.e != 0 || m.f != 0) ) @@ -3032,16 +3033,20 @@ var remapElement = this.remapElement = function(selected,changes,m) { // now we have a set of changes and an applied reduced transform list // we apply the changes directly to the DOM - switch (selected.tagName) + switch (elName) { case "foreignObject": case "rect": case "image": var pt1 = remap(changes.x,changes.y); + + changes.width = scalew(changes.width); + changes.height = scaleh(changes.height); + changes.x = pt1.x + Math.min(0,changes.width); changes.y = pt1.y + Math.min(0,changes.height); - changes.width = Math.abs(scalew(changes.width)); - changes.height = Math.abs(scaleh(changes.height)); + changes.width = Math.abs(changes.width); + changes.height = Math.abs(changes.height); finishUp(); break; case "ellipse":