Пример #1
0
        private Rectangle?_intersectionAbs(Rectangle other)
        {
            Rectangle thisAbs = this.Abs, otherAbs = other.Abs;
            double    l = GMath.Max(thisAbs.Left, otherAbs.Left), r = GMath.Min(thisAbs.Right, otherAbs.Right),
                      t = GMath.Max(thisAbs.Top, otherAbs.Top), b = GMath.Min(thisAbs.Bottom, otherAbs.Bottom);

            if (l > r || t > b)
            {
                return(null);
            }
            else
            {
                return(new Rectangle(l, t, r - l, b - t));
            }
        }