pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1851026 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Fri, 11 Jan 2019 10:33:55 GMT
Author: tilman
Date: Fri Jan 11 10:33:55 2019
New Revision: 1851026

URL: http://svn.apache.org/viewvc?rev=1851026&view=rev
Log:
PDFBOX-4399: refactor

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1851026&r1=1851025&r2=1851026&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Fri Jan
11 10:33:55 2019
@@ -725,25 +725,23 @@ public class PageDrawer extends PDFGraph
                                       RenderingHints.VALUE_ANTIALIAS_OFF);
         }
 
+        Shape shape;
         if (!(graphics.getPaint() instanceof Color))
         {
             // apply clip to path to avoid oversized device bounds in shading contexts (PDFBOX-2901)
             Area area = new Area(linePath);
             area.intersect(new Area(graphics.getClip()));
             intersectShadingBBox(getGraphicsState().getNonStrokingColor(), area);
-            if (isContentRendered())
-            {
-                graphics.fill(area);
-            }
+            shape = area;
         }
         else
         {
-            if (isContentRendered())
-            {
-                graphics.fill(linePath);
-            }
+            shape = linePath;
+        }
+        if (isContentRendered())
+        {
+            graphics.fill(shape);
         }
-        //TODO refactor fill
         
         linePath.reset();
 
@@ -1204,23 +1202,20 @@ public class PageDrawer extends PDFGraph
         // get the transformed BBox and intersect with current clipping path
         // need to do it here and not in shading getRaster() because it may have been rotated
         PDRectangle bbox = shading.getBBox();
+        Area area;
         if (bbox != null)
         {
-            Area bboxArea = new Area(bbox.transform(ctm));
-            bboxArea.intersect(getGraphicsState().getCurrentClippingPath());
-            if (isContentRendered())
-            {
-                graphics.fill(bboxArea);
-            }
+            area = new Area(bbox.transform(ctm));
+            area.intersect(getGraphicsState().getCurrentClippingPath());
         }
         else
         {
-            if (isContentRendered())
-            {
-                graphics.fill(getGraphicsState().getCurrentClippingPath());
-            }
+            area = getGraphicsState().getCurrentClippingPath();
+        }
+        if (isContentRendered())
+        {
+            graphics.fill(area);
         }
-        //TODO refactor fill
     }
 
     @Override



Mime
View raw message