Commit 8a0ca7e5 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 32634

parent af14103f
...@@ -54,9 +54,9 @@ function hitToHandles(x, y, object) ...@@ -54,9 +54,9 @@ function hitToHandles(x, y, object)
radius *= global_mouseEvent.KoefPixToMM; radius *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon) if (global_mouseEvent && global_mouseEvent.AscHitToHandlesEpsilon)
{ {
radius = window.AscHitToHandlesEpsilon; radius = global_mouseEvent.AscHitToHandlesEpsilon;
} }
// чтобы не считать корни // чтобы не считать корни
......
...@@ -23,9 +23,9 @@ function HitInLine(context, px, py, x0, y0, x1, y1) ...@@ -23,9 +23,9 @@ function HitInLine(context, px, py, x0, y0, x1, y1)
d *= global_mouseEvent.KoefPixToMM; d *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon) if (global_mouseEvent && global_mouseEvent.AscHitToHandlesEpsilon)
{ {
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty); d = global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
} }
dx=-ty*d; dx=-ty*d;
...@@ -60,9 +60,9 @@ function HitInBezier4(context, px, py, x0, y0, x1, y1, x2, y2, x3, y3) ...@@ -60,9 +60,9 @@ function HitInBezier4(context, px, py, x0, y0, x1, y1, x2, y2, x3, y3)
d *= global_mouseEvent.KoefPixToMM; d *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon) if (global_mouseEvent && global_mouseEvent.AscHitToHandlesEpsilon)
{ {
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty); d = global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
} }
dx=-ty*d; dx=-ty*d;
...@@ -97,9 +97,9 @@ function HitInBezier3(context, px, py, x0, y0, x1, y1, x2, y2) ...@@ -97,9 +97,9 @@ function HitInBezier3(context, px, py, x0, y0, x1, y1, x2, y2)
d *= global_mouseEvent.KoefPixToMM; d *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon) if (global_mouseEvent && global_mouseEvent.AscHitToHandlesEpsilon)
{ {
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty); d = global_mouseEvent.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
} }
dx=-ty*d; dx=-ty*d;
......
...@@ -52,6 +52,8 @@ function CMouseEventHandler() ...@@ -52,6 +52,8 @@ function CMouseEventHandler()
this.buttonObject = null; this.buttonObject = null;
this.AscHitToHandlesEpsilon = 0;
this.LockMouse = function() this.LockMouse = function()
{ {
if (!this.IsLocked) if (!this.IsLocked)
...@@ -81,7 +83,7 @@ function CMouseEventHandler() ...@@ -81,7 +83,7 @@ function CMouseEventHandler()
return true; return true;
} }
return false; return false;
} };
this.UnLockMouse = function() this.UnLockMouse = function()
{ {
if (this.IsLocked) if (this.IsLocked)
...@@ -111,7 +113,7 @@ function CMouseEventHandler() ...@@ -111,7 +113,7 @@ function CMouseEventHandler()
return true; return true;
} }
return false; return false;
} };
} }
function CKeyboardEvent() function CKeyboardEvent()
...@@ -129,6 +131,7 @@ function CKeyboardEvent() ...@@ -129,6 +131,7 @@ function CKeyboardEvent()
var global_mouseEvent = new CMouseEventHandler(); var global_mouseEvent = new CMouseEventHandler();
var global_keyboardEvent = new CKeyboardEvent(); var global_keyboardEvent = new CKeyboardEvent();
AscFormat.AscHitToHandlesEpsilon = undefined;
function check_KeyboardEvent(e) function check_KeyboardEvent(e)
{ {
......
...@@ -1531,7 +1531,7 @@ CDrawingDocument.prototype = ...@@ -1531,7 +1531,7 @@ CDrawingDocument.prototype =
if (this.Native["GetDeviceDPI"]) if (this.Native["GetDeviceDPI"])
{ {
// 1см // 1см
window.AscHitToHandlesEpsilon = 5 * this.Native["GetDeviceDPI"]() / (25.4 * this.Native["DD_GetDotsPerMM"]() ); global_mouseEvent.AscHitToHandlesEpsilon = 5 * this.Native["GetDeviceDPI"]() / (25.4 * this.Native["DD_GetDotsPerMM"]() );
} }
var _isDrawings = this.LogicDocument.DrawingObjects.isPointInDrawingObjects2(pos.X, pos.Y, pos.Page, true); var _isDrawings = this.LogicDocument.DrawingObjects.isPointInDrawingObjects2(pos.X, pos.Y, pos.Page, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment