Esempio n. 1
0
 public static void MapPoints(this Matrix3X3 matrix, ref Vector2[] points)
 {
     for (var i = 0; i < points.Length; i++)
     {
         points[i] = matrix.Transform(points[i]);
     }
 }
Esempio n. 2
0
            public void Transform(Matrix3X3 matrix)
            {
                var p = new Vector2(_points[0], _points[1]);

                p = matrix.Transform(p);

                _points[0] = p.X;
                _points[1] = p.Y;
            }
Esempio n. 3
0
        public static void MapRect(this Matrix3X3 matrix, ref Rect rect)
        {
            var p1 = new Vector2((float)rect.Left, (float)rect.Top);
            var p2 = new Vector2((float)rect.Right, (float)rect.Top);
            var p3 = new Vector2((float)rect.Left, (float)rect.Bottom);
            var p4 = new Vector2((float)rect.Right, (float)rect.Bottom);

            p1 = matrix.Transform(p1);
            p2 = matrix.Transform(p2);
            p3 = matrix.Transform(p3);
            p4 = matrix.Transform(p4);

            var xMin = Math.Min(Math.Min(Math.Min(p1.X, p2.X), p3.X), p4.X);
            var xMax = Math.Max(Math.Max(Math.Max(p1.X, p2.X), p3.X), p4.X);
            var yMax = Math.Max(Math.Max(Math.Max(p1.Y, p2.Y), p3.Y), p4.Y);
            var yMin = Math.Min(Math.Min(Math.Min(p1.Y, p2.Y), p3.Y), p4.Y);

            RectExt.Set(ref rect, new Rect(xMin, yMax, xMax, yMin));
        }
Esempio n. 4
0
            public void Transform(Matrix3X3 matrix)
            {
                _startPoint = matrix.Transform(_startPoint);
                _endPoint   = matrix.Transform(_endPoint);

                var p1 = new Vector2((float)_rect.Left, (float)_rect.Top);
                var p2 = new Vector2((float)_rect.Right, (float)_rect.Top);
                var p3 = new Vector2((float)_rect.Left, (float)_rect.Bottom);
                var p4 = new Vector2((float)_rect.Right, (float)_rect.Bottom);

                p1 = matrix.Transform(p1);
                p2 = matrix.Transform(p2);
                p3 = matrix.Transform(p3);
                p4 = matrix.Transform(p4);

                _a = (p2 - p1).Length() / 2;
                _b = (p4 - p3).Length() / 2;
            }
Esempio n. 5
0
 public void Transform(Matrix3X3 matrix)
 {
     _control1 = matrix.Transform(_control1);
     _control2 = matrix.Transform(_control2);
     _vertex   = matrix.Transform(_vertex);
 }