From 2ff6a4bf11302d6f41b1a299e2e4f560cc81ea7b Mon Sep 17 00:00:00 2001 From: Eliot Jones Date: Fri, 6 Dec 2019 13:36:45 +0000 Subject: [PATCH] handle rotations of 360 degrees or more #90 --- src/UglyToad.PdfPig/Content/PageRotationDegrees.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs b/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs index 5d4c0fb9..c2406931 100644 --- a/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs +++ b/src/UglyToad.PdfPig/Content/PageRotationDegrees.cs @@ -47,6 +47,11 @@ /// Rotation in degrees clockwise. 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}.");