Commit a2626dd4 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

попадание ios

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61593 954022d7-b5bf-4e40-9824-e11837661b57
parent b10cebc3
...@@ -123,6 +123,16 @@ function hitToHandles(x, y, object) ...@@ -123,6 +123,16 @@ function hitToHandles(x, y, object)
} }
} }
// теперь смотрим расстояние до центра фигуры, чтобы можно было двигать маленькую
dist_x = t_x - hc;
dist_y = t_y - vc;
_tmp_dist = dist_x * dist_x + dist_y * dist_y;
if (_tmp_dist < _min_dist && !check_line)
{
_min_dist = _tmp_dist;
_ret_value = -1;
}
if (_min_dist < radius) if (_min_dist < radius)
return _ret_value; return _ret_value;
......
...@@ -20,6 +20,11 @@ function HitInLine(context, px, py, x0, y0, x1, y1) ...@@ -20,6 +20,11 @@ function HitInLine(context, px, py, x0, y0, x1, y1)
d *= global_mouseEvent.KoefPixToMM; d *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon)
{
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
}
dx=-ty*d; dx=-ty*d;
dy=tx*d; dy=tx*d;
...@@ -52,6 +57,11 @@ function HitInBezier4(context, px, py, x0, y0, x1, y1, x2, y2, x3, y3) ...@@ -52,6 +57,11 @@ 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)
{
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
}
dx=-ty*d; dx=-ty*d;
dy=tx*d; dy=tx*d;
...@@ -84,6 +94,11 @@ function HitInBezier3(context, px, py, x0, y0, x1, y1, x2, y2) ...@@ -84,6 +94,11 @@ function HitInBezier3(context, px, py, x0, y0, x1, y1, x2, y2)
d *= global_mouseEvent.KoefPixToMM; d *= global_mouseEvent.KoefPixToMM;
} }
if (undefined !== window.AscHitToHandlesEpsilon)
{
d = window.AscHitToHandlesEpsilon/Math.sqrt(tx*tx+ty*ty);
}
dx=-ty*d; dx=-ty*d;
dy=tx*d; dy=tx*d;
......
...@@ -1634,7 +1634,7 @@ CDrawingDocument.prototype = ...@@ -1634,7 +1634,7 @@ CDrawingDocument.prototype =
if (this.Native["GetDeviceDPI"]) if (this.Native["GetDeviceDPI"])
{ {
// 1см // 1см
window.AscHitToHandlesEpsilon = 10 * this.Native["GetDeviceDPI"]() / (25.4 * this.Native["DD_GetDotsPerMM"]() ); window.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