Nez.Portable/Math/RectangleF.cs
/// <summary>
/// Creates a new <see cref="RectangleF"/> where the rectangles overlap.
/// </summary>
/// <param name="value1">The first <see cref="RectangleF"/>.</param>
/// <param name="value2">The second <see cref="RectangleF"/>.</param>
/// <returns>The overlap of the two rectangles.</returns>
Creates a new  where the rectangles overlap.
Creates a new where the rectangles overlap .
public static RectangleF overlap(RectangleF value1, RectangleF value2)
        {
            var x = Math.Max(Math.Max(value1.x, value2.x), 0);
            var y = Math.Max(Math.Max(value1.y, value2.y), 0);
            return new RectangleF(
                x,
                y,
                Math.Max(Math.Min(value1.right, value2.right) - x, 0),
                Math.Max(Math.Min(value1.bottom, value2.bottom) - y, 0));
        }
public static RectangleF overlap ( RectangleF value1 , RectangleF value2 ) { var x = Math . Max ( Math . Max ( value1 . x , value2 . x ) , 0 ) ; var y = Math . Max ( Math . Max ( value1 . y , value2 . y ) , 0 ) ; return new RectangleF ( x , y , Math . Max ( Math . Min ( value1 . right , value2 . right ) - x , 0 ) , Math . Max ( Math . Min ( value1 . bottom , value2 . bottom ) - y , 0 ) ) ; }
Creates a new  where the rectangles overlap.
Creates a new where the rectangles overlap .
The overlap of the two rectangles.
The overlap of the two rectangles .
value1
RectangleF
The first .
The first .
value2
RectangleF
The second .
The second .