From 4c4db71652dce6ff99f52a96844e7196f89fafca Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 23 Feb 2011 16:44:20 +0000 Subject: [PATCH] Fixed rest of Issue 782: Text editing is buggy (IE9) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1999 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index ddad2106..a2278097 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3766,13 +3766,12 @@ var textActions = canvas.textActions = function() { // textActions.toSelectMode(true); // } - // For some reason points in IE are off by 1 - if(svgedit.browser.isIE()) { - mouse_x++; - mouse_y++; - } - - if(last_x === mouse_x && last_y === mouse_y && evt.target !== curtext) { + if( + evt.target !== curtext + && mouse_x < last_x + 2 + && mouse_x > last_x - 2 + && mouse_y < last_y + 2 + && mouse_y > last_y - 2) { textActions.toSelectMode(true); } @@ -3883,6 +3882,9 @@ var textActions = canvas.textActions = function() { var offset = canvas.contentW * current_zoom; start.x -= offset; end.x -= offset; + + start.x /= current_zoom; + end.x /= current_zoom; } // Get a "bbox" equivalent for each character. Uses the