Fix Issue 150: Merge antimatter15's patch - thanks

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@508 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-08-31 17:48:36 +00:00
parent 402187cba4
commit 1b3ada5449
1 changed files with 2 additions and 1 deletions

View File

@ -1710,7 +1710,8 @@ function SvgCanvas(c)
break;
case "rotate":
var box = canvas.getBBox(selected),cx = box.x + box.width/2, cy = box.y + box.height/2;
canvas.setRotationAngle(parseInt(((Math.atan2(cy-y,cx-x) * (180/Math.PI))-90) % 360));
var angle = parseInt(((Math.atan2(cy-y,cx-x) * (180/Math.PI))-90) % 360);
canvas.setRotationAngle(angle<-180?(360+angle):angle);
break;
default:
break;