Fix for issue 1046: Firefox drag-and-drop bug with elements in scaled canvas

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2330 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Luis Aguirre 2013-02-06 15:49:12 +00:00
parent f410e21006
commit 522b0d6f35
1 changed files with 11 additions and 0 deletions

View File

@ -2365,6 +2365,17 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
root_sctm = svgcontent.getScreenCTM().inverse();
// Firefox issue 1046
if(current_zoom != 1 && root_sctm.a == 1)
{
matrix_e = root_sctm.e / current_zoom - root_sctm.e;
matrix_f = root_sctm.f / current_zoom - root_sctm.f;
matrix_scale = 1/current_zoom;
root_sctm = svgcontent.getScreenCTM().inverse()
.translate(matrix_e, matrix_f)
.scale(matrix_scale);
}
var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
mouse_x = pt.x * current_zoom,
mouse_y = pt.y * current_zoom;