Rectangle Merge Method Delta Engine Documentation

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public Rectangle Merge(
	Rectangle other
)

Return Value

Type: Rectangle
Remarks

Tests: DeltaEngine.Tests.Datatypes.RectangleTests
Examples

1 unit tests call DeltaEngine.Datatypes.Rectangle.Merge(DeltaEngine.Datatypes.Rectangle)
[Test]
public void MergeRectangles()
{
    var leftUpperRect = new Rectangle(-3.0f, -4.5f, 0.6f, 1.0f);
    var rightUpperRect = new Rectangle(5.0f, -3.0f, 1.0f, 1.0f);
    var leftLowerRect = new Rectangle(-4.0f, 6.2f, 1.0f, 0.8f);
    var rightLowerRect = new Rectangle(2.0f, 1.0f, 0.5f, 0.5f);
    Assert.AreEqual(new Rectangle(-3.0f, -4.5f, 9.0f, 2.5f), leftUpperRect.Merge(rightUpperRect));
    Assert.AreEqual(new Rectangle(2.0f, -3.0f, 4.0f, 4.5f), rightLowerRect.Merge(rightUpperRect));
    Assert.AreEqual(new Rectangle(-4.0f, -3.0f, 10.0f, 10.0f),
        leftLowerRect.Merge(rightUpperRect));
}
See Also