Пример #1
0
 public static void MapPoints(this Matrix3X3 matrix, ref Vector2[] points)
 {
     for (int i = 0; i < points.Length; i++)
     {
         points[i] = matrix.Transform(points[i]);
     }
 }
Пример #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;
            }
Пример #3
0
        public static void MapRect(this Matrix3X3 matrix, ref SkiaSharp.SKRect 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, SkRectExpansion.CreateSkRect(new SkiaSharp.SKPoint(xMin, yMax), new SkiaSharp.SKPoint(xMax, yMin)));
        }
Пример #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;
                }
Пример #5
0
 public void Transform(Matrix3X3 matrix)
 {
     _startPoint = matrix.Transform(_startPoint);
     _endPoint   = matrix.Transform(_endPoint);
 }
Пример #6
0
 public void Transform(Matrix3X3 matrix)
 {
     _control1 = matrix.Transform(_control1);
     _control2 = matrix.Transform(_control2);
     _vertex   = matrix.Transform(_vertex);
 }