pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1618494 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java
Date Sun, 17 Aug 2014 18:53:47 GMT
Author: tilman
Date: Sun Aug 17 18:53:47 2014
New Revision: 1618494

URL: http://svn.apache.org/r1618494
Log:
PDFBOX-1094: set pattern sizes < 1 to 1

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java?rev=1618494&r1=1618493&r2=1618494&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/TilingPaint.java
Sun Aug 17 18:53:47 2014
@@ -119,6 +119,14 @@ public class TilingPaint extends Texture
         Rectangle2D rect = getTransformedRect(pattern);
         int width = Math.round((float) rect.getWidth());
         int height = Math.round((float) rect.getHeight());
+        if (width < 1)
+        {
+            width = 1;
+        }
+        if (height < 1)
+        {
+            height = 1;
+        }        
 
         // create raster
         WritableRaster raster = cm.createCompatibleWritableRaster(width, height);



Mime
View raw message