Author: tilman Date: Tue Aug 12 09:32:46 2025 New Revision: 1927766 Log: PDFBOX-6049: use quadrantrotate, change int to short
Modified: pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Modified: pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java ============================================================================== --- pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Tue Aug 12 09:32:33 2025 (r1927765) +++ pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Tue Aug 12 09:32:46 2025 (r1927766) @@ -285,9 +285,9 @@ public class Overlay implements Closeabl private final PDRectangle overlayMediaBox; private final COSStream overlayCOSStream; private final COSDictionary overlayResources; - private final short overlayRotation; + private final int overlayRotation; - private LayoutPage(PDRectangle mediaBox, COSStream contentStream, COSDictionary resources, short rotation) + private LayoutPage(PDRectangle mediaBox, COSStream contentStream, COSDictionary resources, int rotation) { overlayMediaBox = mediaBox; overlayCOSStream = contentStream; @@ -323,7 +323,7 @@ public class Overlay implements Closeabl resources = new PDResources(); } return new LayoutPage(page.getMediaBox(), createCombinedContentStream(contents), - resources.getCOSObject(), (short) page.getRotation()); + resources.getCOSObject(), page.getRotation()); } private Map<Integer,LayoutPage> createPageOverlayLayoutPageMap(PDDocument doc) throws IOException @@ -513,15 +513,15 @@ public class Overlay implements Closeabl { case 90: at.translate(0, layoutPage.overlayMediaBox.getWidth()); - at.rotate(Math.toRadians(-90)); + at.quadrantRotate(3); // 270 break; case 180: at.translate(layoutPage.overlayMediaBox.getWidth(), layoutPage.overlayMediaBox.getHeight()); - at.rotate(Math.toRadians(-180)); + at.quadrantRotate(2); // 180 break; case 270: at.translate(layoutPage.overlayMediaBox.getHeight(), 0); - at.rotate(Math.toRadians(-270)); + at.quadrantRotate(1); // 90 break; default: break;