pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1656958 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java
Date Wed, 04 Feb 2015 00:43:23 GMT
Author: jahewson
Date: Wed Feb  4 00:43:22 2015
New Revision: 1656958

URL: http://svn.apache.org/r1656958
Log:
PDFBOX-2660: Perform deep clone of clipping path

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java?rev=1656958&r1=1656957&r2=1656958&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java
Wed Feb  4 00:43:22 2015
@@ -562,7 +562,11 @@ public class PDGraphicsState implements
         // lazy cloning of clipping path for performance
         if (!isClippingPathDirty)
         {
-            clippingPath = (Area) clippingPath.clone();
+            // deep copy (can't use clone() as it performs only a shallow copy)
+            Area cloned = new Area();
+            cloned.add(area);
+            
+            clippingPath = cloned;
             isClippingPathDirty = true;
         }
 



Mime
View raw message