fixes for the latest version of Firefox
parent
92bba1368b
commit
ca4a2c682e
|
@ -2368,13 +2368,14 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||||
{
|
{
|
||||||
if (canvas.spaceKey) return;
|
if (canvas.spaceKey) return;
|
||||||
var right_click = evt.button === 2;
|
var right_click = evt.button === 2;
|
||||||
|
|
||||||
root_sctm = svgcontent.getScreenCTM().inverse();
|
root_sctm = svgcontent.querySelector("g").getScreenCTM().inverse();
|
||||||
isBotchedZoom = svgedit.browser.isGecko();
|
|
||||||
var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
var pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
||||||
mouse_x = pt.x * (isBotchedZoom ? 1 : current_zoom),
|
mouse_x = pt.x * current_zoom,
|
||||||
mouse_y = pt.y * (isBotchedZoom ? 1 : current_zoom);
|
mouse_y = pt.y * current_zoom;
|
||||||
|
|
||||||
|
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
||||||
if(right_click) {
|
if(right_click) {
|
||||||
|
@ -2724,13 +2725,13 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||||
// in this function we do not record any state changes yet (but we do update
|
// in this function we do not record any state changes yet (but we do update
|
||||||
// any elements that are still being created, moved or resized on the canvas)
|
// any elements that are still being created, moved or resized on the canvas)
|
||||||
var mouseMove = function(evt) {
|
var mouseMove = function(evt) {
|
||||||
if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return;
|
if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return;
|
||||||
if (!started) return;
|
if (!started) return;
|
||||||
if(evt.button === 1 || canvas.spaceKey) return;
|
if(evt.button === 1 || canvas.spaceKey) return;
|
||||||
var selected = selectedElements[0],
|
var selected = selectedElements[0],
|
||||||
pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
pt = transformPoint( evt.pageX, evt.pageY, root_sctm ),
|
||||||
mouse_x = pt.x * (isBotchedZoom ? 1 : current_zoom),
|
mouse_x = pt.x * current_zoom,
|
||||||
mouse_y = pt.y * (isBotchedZoom ? 1 : current_zoom),
|
mouse_y = pt.y * current_zoom,
|
||||||
shape = getElem(getId());
|
shape = getElem(getId());
|
||||||
|
|
||||||
var real_x = x = mouse_x / current_zoom;
|
var real_x = x = mouse_x / current_zoom;
|
||||||
|
@ -3273,9 +3274,8 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||||
recalculateAllSelectedDimensions();
|
recalculateAllSelectedDimensions();
|
||||||
|
|
||||||
// if it was being dragged/resized
|
// if it was being dragged/resized
|
||||||
var isBotchedZoom = svgedit.browser.isGecko();
|
r_start_x = r_start_x;
|
||||||
r_start_x = isBotchedZoom ? r_start_x * current_zoom : r_start_x;
|
r_start_y = r_start_y;
|
||||||
r_start_y = isBotchedZoom ? r_start_y * current_zoom : r_start_y;
|
|
||||||
var difference_x = Math.abs(real_x-r_start_x);
|
var difference_x = Math.abs(real_x-r_start_x);
|
||||||
var difference_y = Math.abs(real_y-r_start_y);
|
var difference_y = Math.abs(real_y-r_start_y);
|
||||||
|
|
||||||
|
|
|
@ -3274,6 +3274,7 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
|
||||||
|
|
||||||
// if it was being dragged/resized
|
// if it was being dragged/resized
|
||||||
var isBotchedZoom = svgedit.browser.isGecko();
|
var isBotchedZoom = svgedit.browser.isGecko();
|
||||||
|
console.log(current_zoom)
|
||||||
r_start_x = isBotchedZoom ? r_start_x * current_zoom : r_start_x;
|
r_start_x = isBotchedZoom ? r_start_x * current_zoom : r_start_x;
|
||||||
r_start_y = isBotchedZoom ? r_start_y * current_zoom : r_start_y;
|
r_start_y = isBotchedZoom ? r_start_y * current_zoom : r_start_y;
|
||||||
var difference_x = Math.abs(real_x-r_start_x);
|
var difference_x = Math.abs(real_x-r_start_x);
|
||||||
|
|
Loading…
Reference in New Issue