From 5a62f3b209aa6e6970bdc0dabf00b35dbdb26705 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Wed, 26 Aug 2009 19:45:28 +0000 Subject: [PATCH] Second part of Issue 103: tracking of mouse events and new 'rotate' state. Does not actually rotate the element yet. git-svn-id: http://svg-edit.googlecode.com/svn/trunk@477 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 7a478d0f..23eedae8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -269,6 +269,9 @@ function SvgCanvas(c) current_mode = "resize"; current_resize_mode = this.id.substr(13,this.id.indexOf("_",13)-13); }); + $('#selectorGrip_rotate_'+id).mousedown( function() { + current_mode = "rotate"; + }); } this.showGrips = function(show) { @@ -1368,6 +1371,9 @@ function SvgCanvas(c) }, 100); } + break; + case "rotate": + started = true; break; default: console.log("Unknown mode in mousedown: " + current_mode); @@ -1660,6 +1666,8 @@ function SvgCanvas(c) } } break; + case "rotate": + break; default: break; } @@ -2026,6 +2034,11 @@ function SvgCanvas(c) canvas.addToSelection([evt.target]); } break; + case "rotate": + keep = true; + element = null; + current_mode = "select"; + break; default: console.log("Unknown mode in mouseup: " + current_mode); break;