From 143680e3eec598c6fa338b6e67587b9e44edcdf1 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Thu, 27 Aug 2009 01:03:08 +0000 Subject: [PATCH] Final fix for Issue 103: merge in modified patch from antimatter15 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@481 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 1f9064d4..044089b7 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1683,14 +1683,8 @@ function SvgCanvas(c) } break; case "rotate": - // TODO: figure out cx,cy of rotated handle in absolute coords - // TODO: determine new angle that will minimize the distance from x,y to cx,cy - // TODO: rotate the shape by that angle, setRotationAngle() - - var angle = canvas.getRotationAngle(current_poly) * Math.PI / 180.0; - if (angle) { - } - + var box = canvas.getBBox(selected),cx = box.x + box.width/2, cy = box.y + box.height/2; + canvas.setRotationAngle(((Math.atan2(cy-y,cx-x) * (180/Math.PI))-90) % 360); break; default: break;