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

rotate in track

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57330 954022d7-b5bf-4e40-9824-e11837661b57
parent 768d5b94
...@@ -1062,7 +1062,19 @@ CAutoshapeTrack.prototype = ...@@ -1062,7 +1062,19 @@ CAutoshapeTrack.prototype =
_w2 += 1; _w2 += 1;
} }
ctx.setTransform(ex1, ey1, -ey1, ex1, _xI, _yI); //ctx.setTransform(ex1, ey1, -ey1, ex1, _xI, _yI);
var _matrix = matrix.CreateDublicate();
_matrix.tx = 0;
_matrix.ty = 0;
var _xx = _matrix.TransformPointX(0, 1);
var _yy = _matrix.TransformPointY(0, 1);
var _angle = Math.atan2(_xx, -_yy) - Math.PI;
var _px = Math.cos(_angle);
var _py = Math.sin(_angle);
ctx.translate(_xI, _yI);
ctx.transform(_px, _py, -_py, _px, 0, 0);
ctx.drawImage(window.g_track_rotate_marker, -_w2, -_w2, _w, _w); ctx.drawImage(window.g_track_rotate_marker, -_w2, -_w2, _w, _w);
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);
...@@ -1397,7 +1409,19 @@ CAutoshapeTrack.prototype = ...@@ -1397,7 +1409,19 @@ CAutoshapeTrack.prototype =
_w2 += 1; _w2 += 1;
} }
ctx.setTransform(ex1, ey1, -ey1, ex1, _xI, _yI); //ctx.setTransform(ex1, ey1, -ey1, ex1, _xI, _yI);
var _matrix = matrix.CreateDublicate();
_matrix.tx = 0;
_matrix.ty = 0;
var _xx = _matrix.TransformPointX(0, 1);
var _yy = _matrix.TransformPointY(0, 1);
var _angle = Math.atan2(_xx, -_yy) - Math.PI;
var _px = Math.cos(_angle);
var _py = Math.sin(_angle);
ctx.translate(_xI, _yI);
ctx.transform(_px, _py, -_py, _px, 0, 0);
ctx.drawImage(window.g_track_rotate_marker, -_w2, -_w2, _w, _w); ctx.drawImage(window.g_track_rotate_marker, -_w2, -_w2, _w, _w);
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);
......
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