OrientationTests TestDrawAreaWhenChangingOrientationToLandscape Method Delta Engine Documentation

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

public void TestDrawAreaWhenChangingOrientationToLandscape()
Examples

[Test, Category("Slow"), CloseAfterFirstFrame]
public void TestDrawAreaWhenChangingOrientationToLandscape()
{
    new Ellipse(new Rectangle(0.7f, 0.7f, 0.1f, 0.1f), Color.Red);
    RunAfterFirstFrame(() =>
    {
        Resolve<Window>().ViewportPixelSize = new Size(800, 480);
        var screen = ScreenSpace.Current;
        var quadSize = screen.FromPixelSpace(new Vector2D(0, 0));
        ArePointsNearlyEqual(new Vector2D(0f, 0.2f), quadSize);
        quadSize = screen.FromPixelSpace(new Vector2D(800, 480));
        ArePointsNearlyEqual(new Vector2D(1, 0.8f), quadSize);
        var pixelSize = screen.ToPixelSpace(new Vector2D(0f, 0.2f));
        ArePointsNearlyEqual(Vector2D.Zero, pixelSize);
        pixelSize = screen.ToPixelSpace(new Vector2D(1, 0.8f));
        ArePointsNearlyEqual(new Vector2D(800, 480), pixelSize);
    });
}
See Also