handle rotations of 360 degrees or more #90

This commit is contained in:
Eliot Jones
2019-12-06 13:36:45 +00:00
parent d6e1dccc01
commit 2ff6a4bf11

View File

@@ -47,6 +47,11 @@
/// <param name="rotation">Rotation in degrees clockwise.</param>
public PageRotationDegrees(int rotation)
{
while (rotation >= 360)
{
rotation -= 360;
}
if (rotation != 0 && rotation != 90 && rotation != 180 && rotation != 270)
{
throw new ArgumentOutOfRangeException(nameof(rotation), $"Rotation must be 0, 90, 180 or 270. Got: {rotation}.");