From 1b3ada54495a894cd743afba08cf8487ab815a4e Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Mon, 31 Aug 2009 17:48:36 +0000 Subject: [PATCH] Fix Issue 150: Merge antimatter15's patch - thanks git-svn-id: http://svg-edit.googlecode.com/svn/trunk@508 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 12b27088..5f66d1c1 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -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;