From a689875c275b32f85d36d7f5cfdd515871fb21da Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Tue, 29 Sep 2009 20:49:18 +0000 Subject: [PATCH] Fix for odd polyedit drag error when a poly is rotated (Issue 118) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@741 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index d3ebc484..7b156966 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1949,6 +1949,7 @@ function BatchCommand(text) { // if the image is rotated, then we must modify the x,y mouse coordinates // and rotate them into the shape's rotated coordinate system + // we also re-map mouse_x/y and x/y into the rotated coordinate system var angle = canvas.getRotationAngle(current_poly) * Math.PI / 180.0; if (angle) { // calculate the shape's old center that was used for rotation @@ -1960,6 +1961,8 @@ function BatchCommand(text) { var theta = Math.atan2(dy,dx) - angle; current_poly_pts[i] = mouse_x = cx + r * Math.cos(theta); current_poly_pts[i+1] = mouse_y = cy + r * Math.sin(theta); + x = mouse_x / current_zoom; + y = mouse_y / current_zoom; } else { current_poly_pts[i] = x * current_zoom;