OpenTK.Graphics.Rectangle.IntersectsWithInclusive C# (CSharp) Method

IntersectsWithInclusive() private method

private IntersectsWithInclusive ( Rectangle r ) : bool
r Rectangle
return bool
        private bool IntersectsWithInclusive(Rectangle r)
        {
            return !((Left > r.Right) || (Right < r.Left) ||
                (Top > r.Bottom) || (Bottom < r.Top));
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        ///	Intersect Shared Method
        /// </summary>
        ///
        /// <remarks>
        ///	Produces a new Rectangle by intersecting 2 existing
        ///	Rectangles. Returns null if there is no	intersection.
        /// </remarks>

        public static Rectangle Intersect(Rectangle a, Rectangle b)
        {
            // MS.NET returns a non-empty rectangle if the two rectangles
            // touch each other
            if (!a.IntersectsWithInclusive(b))
            {
                return(Empty);
            }
            return(Rectangle.FromLTRB(
                       Math.Max(a.Left, b.Left),
                       Math.Max(a.Top, b.Top),
                       Math.Min(a.Right, b.Right),
                       Math.Min(a.Bottom, b.Bottom)));
        }
All Usage Examples Of OpenTK.Graphics.Rectangle::IntersectsWithInclusive