Nez.Portable/Utils/Extensions/RectangleExt.cs
/// <summary>
/// calculates the union of the two Rectangles. The result will be a rectangle that encompasses the other two.
/// </summary>
/// <param name="first">First.</param>
/// <param name="second">Second.</param>
/// <param name="result">Result.</param>
calculates the union of the two Rectangles. The result will be a rectangle that encompasses the other two.
calculates the union of the two Rectangles . The result will be a rectangle that encompasses the other two .
public static void union(ref Rectangle value1, ref Rectangle value2, out Rectangle result)
        {
            result.X = Math.Min(value1.X, value2.X);
            result.Y = Math.Min(value1.Y, value2.Y);
            result.Width = Math.Max(value1.Right, value2.Right) - result.X;
            result.Height = Math.Max(value1.Bottom, value2.Bottom) - result.Y;
        }
public static void union ( ref Rectangle value1 , ref Rectangle value2 , out Rectangle result ) { result . X = Math . Min ( value1 . X , value2 . X ) ; result . Y = Math . Min ( value1 . Y , value2 . Y ) ; result . Width = Math . Max ( value1 . Right , value2 . Right ) - result . X ; result . Height = Math . Max ( value1 . Bottom , value2 . Bottom ) - result . Y ; }
calculates the union of the two Rectangles.
calculates the union of the two Rectangles .
Rectangle
out
first
None
second
None
result
None