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>
/// <param name="result">The overlap of the two rectangles as an output parameter.</param>
Creates a new  where the rectangles overlap.
Creates a new where the rectangles overlap .
public static void overlap(ref RectangleF value1, ref RectangleF value2, out RectangleF result)
        {
            result.x = Math.Max(Math.Max(value1.x, value2.x), 0);
            result.y = Math.Max(Math.Max(value1.y, value2.y), 0);
            result.width = Math.Max(Math.Min(value1.right, value2.right) - result.x, 0);
            result.height = Math.Max(Math.Min(value1.bottom, value2.bottom) - result.y, 0);
        }
public static void overlap ( ref RectangleF value1 , ref RectangleF value2 , out RectangleF result ) { result . x = Math . Max ( Math . Max ( value1 . x , value2 . x ) , 0 ) ; result . y = Math . Max ( Math . Max ( value1 . y , value2 . y ) , 0 ) ; result . width = Math . Max ( Math . Min ( value1 . right , value2 . right ) - result . x , 0 ) ; result . height = Math . Max ( Math . Min ( value1 . bottom , value2 . bottom ) - result . y , 0 ) ; }
Creates a new  where the rectangles overlap.
Creates a new where the rectangles overlap .
RectangleF
out
value1
The first .
The first .
value2
The second .
The second .
result
The overlap of the two rectangles as an output parameter.
The overlap of the two rectangles as an output parameter .