Fixed bug in last checkin

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1789 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-10-08 19:38:40 +00:00
parent 39f8a8b499
commit 89a918a4f0
1 changed files with 9 additions and 4 deletions

View File

@ -3008,7 +3008,8 @@ var remapElement = this.remapElement = function(selected,changes,m) {
} }
box = getBBox(selected); 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 it was a translate, then just update x,y
if (m.a == 1 && m.b == 0 && m.c == 0 && m.d == 1 && if (m.a == 1 && m.b == 0 && m.c == 0 && m.d == 1 &&
(m.e != 0 || m.f != 0) ) (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 // now we have a set of changes and an applied reduced transform list
// we apply the changes directly to the DOM // we apply the changes directly to the DOM
switch (selected.tagName) switch (elName)
{ {
case "foreignObject": case "foreignObject":
case "rect": case "rect":
case "image": case "image":
var pt1 = remap(changes.x,changes.y); 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.x = pt1.x + Math.min(0,changes.width);
changes.y = pt1.y + Math.min(0,changes.height); changes.y = pt1.y + Math.min(0,changes.height);
changes.width = Math.abs(scalew(changes.width)); changes.width = Math.abs(changes.width);
changes.height = Math.abs(scaleh(changes.height)); changes.height = Math.abs(changes.height);
finishUp(); finishUp();
break; break;
case "ellipse": case "ellipse":