Author: jeremias
Date: Thu Feb 10 12:43:14 2011
New Revision: 1069366

URL: http://svn.apache.org/viewvc?rev=1069366&view=rev
Log:
Fix IF test for color_1.xml.
The round-trip for the rgb() was not working with ColorUtil.isSameColor() as 
that checks deeper than just Color.equals().

Modified:
    
xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/util/ColorUtil.java

Modified: 
xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/util/ColorUtil.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/util/ColorUtil.java?rev=1069366&r1=1069365&r2=1069366&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/util/ColorUtil.java 
(original)
+++ 
xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/util/ColorUtil.java 
Thu Feb 10 12:43:14 2011
@@ -238,7 +238,11 @@ public final class ColorUtil {
                 float red = parseComponent255(args[0], value);
                 float green = parseComponent255(args[1], value);
                 float blue = parseComponent255(args[2], value);
-                parsedColor = new Color(red, green, blue);
+                //Convert to ints to synchronize the behaviour with 
toRGBFunctionCall()
+                int r = (int)(red * 255 + 0.5);
+                int g = (int)(green * 255 + 0.5);
+                int b = (int)(blue * 255 + 0.5);
+                parsedColor = new Color(r, g, b);
             } catch (PropertyException pe) {
                 //simply re-throw
                 throw pe;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to