pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1692311 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Wed, 22 Jul 2015 18:19:13 GMT
Author: tilman
Date: Wed Jul 22 18:19:12 2015
New Revision: 1692311

URL: http://svn.apache.org/r1692311
Log:
PDFBOX-2901: apply clip to path to avoid oversized device bounds in shading contexts

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=1692311&r1=1692310&r2=1692311&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 Wed Jul
22 18:19:12 2015
@@ -598,7 +598,18 @@ public class PageDrawer extends PDFGraph
                                       RenderingHints.VALUE_ANTIALIAS_OFF);
         }
 
-        graphics.fill(linePath);
+        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()));
+            graphics.fill(area);
+        }
+        else
+        {
+            graphics.fill(linePath);
+        }
+        
         linePath.reset();
 
         if (noAntiAlias)



Mime
View raw message