You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2021/10/14 18:09:32 UTC

svn commit: r1894255 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Author: tilman
Date: Thu Oct 14 18:09:32 2021
New Revision: 1894255

URL: http://svn.apache.org/viewvc?rev=1894255&view=rev
Log:
PDFBOX-4892: reactor to eliminate variable that isn't needed

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1894255&r1=1894254&r2=1894255&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Thu Oct 14 18:09:32 2021
@@ -1678,8 +1678,9 @@ public class PageDrawer extends PDFGraph
                                         (float)clipRect.getWidth(), (float)clipRect.getHeight());
 
             // apply the underlying Graphics2D device's DPI transform
-            AffineTransform dpiTransform = AffineTransform.getScaleInstance(xformScalingFactorX, xformScalingFactorY);
-            Rectangle2D bounds = dpiTransform.createTransformedShape(clipRect).getBounds2D();
+            AffineTransform xformOriginal = xform;
+            xform = AffineTransform.getScaleInstance(xformScalingFactorX, xformScalingFactorY);
+            Rectangle2D bounds = xform.createTransformedShape(clipRect).getBounds2D();
 
             minX = (int) Math.floor(bounds.getMinX());
             minY = (int) Math.floor(bounds.getMinY());
@@ -1756,10 +1757,8 @@ public class PageDrawer extends PDFGraph
 
             // apply device transform (DPI)
             // the initial translation is ignored, because we're not writing into the initial graphics device
-            g.transform(dpiTransform);
+            g.transform(xform);
 
-            AffineTransform xformOriginal = xform;
-            xform = AffineTransform.getScaleInstance(xformScalingFactorX, xformScalingFactorY);
             PDRectangle pageSizeOriginal = pageSize;
             pageSize = new PDRectangle(minX / xformScalingFactorX,
                                        minY / xformScalingFactorY,