Пример #1
0
        public void FromRoix()
        {
            double       x = 1.1, y = 2.2;
            var          rp1  = new RoixPoint(x, y);
            RoixIntPoint rip1 = rp1.ToRoixInt();

            rip1.X.Is((int)Math.Round(rp1.X));
            rip1.Y.Is((int)Math.Round(rp1.Y));
        }
Пример #2
0
        public void Properties(double x, double y, double width, double height)
        {
            var point = new RoixPoint(x, y);
            var size  = new RoixSize(width, height);
            var r     = new RoixIntRect(point.ToRoixInt(), size.ToRoixInt());

            r.X.Is(r.Location.X);
            r.Y.Is(r.Location.Y);
            r.Width.Is(r.Size.Width);
            r.Height.Is(r.Size.Height);

            r.Left.Is(r.X);
            r.Right.Is(r.X + r.Width);
            r.Top.Is(r.Y);
            r.Bottom.Is(r.Y + r.Height);

            r.TopLeft.Is(new(r.Left, r.Top));
            r.TopRight.Is(new(r.Right, r.Top));
            r.BottomLeft.Is(new(r.Left, r.Bottom));
            r.BottomRight.Is(new(r.Right, r.Bottom));
        }