From 990fd92f1c15beecc6c08582e906225fdc52279e Mon Sep 17 00:00:00 2001 From: Andrew Ryabinin Date: Thu, 26 Feb 2015 15:48:27 +0200 Subject: [PATCH] Fixed problem with cursor position in Firefox --- method-draw/src/svgcanvas.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/method-draw/src/svgcanvas.js b/method-draw/src/svgcanvas.js index 5d9d1a7..a732bd6 100644 --- a/method-draw/src/svgcanvas.js +++ b/method-draw/src/svgcanvas.js @@ -2369,11 +2369,11 @@ var getMouseTarget = this.getMouseTarget = function(evt) { if (canvas.spaceKey) return; var right_click = evt.button === 2; - root_sctm = svgcontent.getScreenCTM().inverse(); + root_sctm = $('#svgcontent g')[0].getScreenCTM().inverse(); isBotchedZoom = svgedit.browser.isGecko(); var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ), - mouse_x = pt.x * (isBotchedZoom ? 1 : current_zoom), - mouse_y = pt.y * (isBotchedZoom ? 1 : current_zoom); + mouse_x = pt.x * current_zoom, + mouse_y = pt.y * current_zoom; evt.preventDefault(); @@ -2729,8 +2729,8 @@ var getMouseTarget = this.getMouseTarget = function(evt) { if(evt.button === 1 || canvas.spaceKey) return; var selected = selectedElements[0], pt = transformPoint( evt.pageX, evt.pageY, root_sctm ), - mouse_x = pt.x * (isBotchedZoom ? 1 : current_zoom), - mouse_y = pt.y * (isBotchedZoom ? 1 : current_zoom), + mouse_x = pt.x * current_zoom, + mouse_y = pt.y * current_zoom, shape = getElem(getId()); var real_x = x = mouse_x / current_zoom;