xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r1045110 - /xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
Date Mon, 13 Dec 2010 13:28:17 GMT
Author: jeremias
Date: Mon Dec 13 13:28:17 2010
New Revision: 1045110

URL: http://svn.apache.org/viewvc?rev=1045110&view=rev
Log:
Fix generation of gray tones.

Modified:
    xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java

Modified: xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java?rev=1045110&r1=1045109&r2=1045110&view=diff
==============================================================================
--- xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
(original)
+++ xmlgraphics/commons/branches/Temp_Color/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
Mon Dec 13 13:28:17 2010
@@ -714,12 +714,12 @@ public class PSGenerator implements PSCo
             ColorSpace sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
             comps = color.getColorComponents(sRGB, null);
         }
+        assert comps.length == 3;
         boolean gray = ColorUtil.isGray(color);
         if (gray) {
-            codeBuffer.append(formatDouble(comps[0]));
-        } else {
-            writeSetColor(codeBuffer, comps, gray ? "setgray" : "setrgbcolor");
+            comps = new float[] {comps[0]};
         }
+        writeSetColor(codeBuffer, comps, gray ? "setgray" : "setrgbcolor");
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message