pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1783132 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Wed, 15 Feb 2017 17:58:37 GMT
Author: tilman
Date: Wed Feb 15 17:58:37 2017
New Revision: 1783132

URL: http://svn.apache.org/viewvc?rev=1783132&view=rev
Log:
PDFBOX-3686: adjust color values to be in 0..1 interval

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=1783132&r1=1783131&r2=1783132&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 Wed
Feb 15 17:58:37 2017
@@ -248,8 +248,16 @@ public class PageDrawer extends PDFGraph
         clipWindingRule = oldClipWindingRule;
     }
 
+    private float clampColor(float color)
+    {
+        return color < 0 ? 0 : (color > 1 ? 1 : color);        
+    }
+
     /**
      * Returns an AWT paint for the given PDColor.
+     * 
+     * @param color The color to get a paint for. This can be an actual color or a pattern.
+     * @throws IOException
      */
     protected Paint getPaint(PDColor color) throws IOException
     {



Mime
View raw message