Commit 096e02d9 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

получение радиусов для определения попадания в якорьки сделано через convertMetric

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47766 954022d7-b5bf-4e40-9824-e11837661b57
parent 111844eb
......@@ -303,7 +303,7 @@ CGroupShape.prototype =
getRotateAngle: function(x, y)
{
var transform = this.getTransform();
var rotate_distance = 5;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
var hc = this.extX*0.5;
var vc = this.extY*0.5;
var xc_t = transform.TransformPointX(hc, vc);
......@@ -599,7 +599,7 @@ CGroupShape.prototype =
var t_x, t_y;
t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y);
var radius = 5;/*TODO*/
var radius = this.drawingObjects.convertMetric(TRACK_CIRCLE_RADIUS, 0, 3);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
......@@ -642,7 +642,7 @@ CGroupShape.prototype =
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 7;
var rotate_distance = 10;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
dist_y = t_y + rotate_distance;
sqr_y = dist_y*dist_y;
dist_x = t_x - hc;
......
......@@ -463,7 +463,7 @@ CImage.prototype =
var t_x, t_y;
t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y);
var radius = 5;/*TODO*/
var radius = this.drawingObjects.convertMetric(TRACK_CIRCLE_RADIUS, 0, 3);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
......@@ -506,7 +506,7 @@ CImage.prototype =
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 7;
var rotate_distance = 10;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
dist_y = t_y + rotate_distance;
sqr_y = dist_y*dist_y;
dist_x = t_x - hc;
......@@ -614,7 +614,7 @@ CImage.prototype =
getRotateAngle: function(x, y)
{
var transform = this.getTransform();
var rotate_distance = 5;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
var hc = this.extX*0.5;
var vc = this.extY*0.5;
var xc_t = transform.TransformPointX(hc, vc);
......
......@@ -564,7 +564,7 @@ CShape.prototype =
getRotateAngle: function(x, y)
{
var transform = this.getTransform();
var rotate_distance = 5;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
var hc = this.extX*0.5;
var vc = this.extY*0.5;
var xc_t = transform.TransformPointX(hc, vc);
......@@ -673,7 +673,7 @@ CShape.prototype =
var t_x, t_y;
t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y);
var radius = 5;/*TODO*/
var radius = this.drawingObjects.convertMetric(TRACK_CIRCLE_RADIUS, 0, 3);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
......@@ -716,7 +716,7 @@ CShape.prototype =
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 7;
var rotate_distance = 10;/*TODO*/
var rotate_distance = this.drawingObjects.convertMetric(TRACK_DISTANCE_ROTATE, 0, 3);
dist_y = t_y + rotate_distance;
sqr_y = dist_y*dist_y;
dist_x = t_x - hc;
......
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