コード例 #1
0
        public void SetTransform()
        {
            var point1  = new Vector2(10, 10);
            var point2  = new Vector2(10, 90);
            var point3  = new Vector2(50, 50);
            var matrix  = Matrix3x2.CreateTranslation(new Vector2(100, 100));
            var builder = new ShapeBuilder();

            builder.AddLines(point1, point2, point3);
            builder.SetTransform(matrix);
            builder.StartFigure();
            builder.AddLines(point1, point2, point3);
            builder.StartFigure();
            builder.ResetOrigin();
            builder.AddLines(point1, point2, point3);

            var shape = builder.Build().Paths;

            Assert.Equal(10, shape[0].Bounds.Left);
            Assert.Equal(110, shape[1].Bounds.Left);
            Assert.Equal(10, shape[0].Bounds.Left);
        }