Example #1
0
        public static RectDouble FromPixelPoints(PointDouble a, PointDouble b)
        {
            RectDouble num  = RectDouble.FromCorners(a, b);
            double     num2 = num.Width + 1.0;

            num.Width  = num2;
            num2       = num.Height + 1.0;
            num.Height = num2;
            return(num);
        }
Example #2
0
        public static RectDouble FromPointsConstrained(PointDouble a, PointDouble b)
        {
            int         num  = Math.Sign((double)(b.X - a.X));
            int         num2 = Math.Sign((double)(b.Y - a.Y));
            double      num4 = Math.Min(Math.Abs((double)(b.X - a.X)), Math.Abs((double)(b.Y - a.Y)));
            double      x    = a.X + (num4 * num);
            double      y    = a.Y + (num4 * num2);
            PointDouble num7 = new PointDouble(x, y);

            return(RectDouble.FromCorners(a, num7));
        }