Revision: 30448
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30448
Author:   blendix
Date:     2010-07-17 23:01:00 +0200 (Sat, 17 Jul 2010)

Log Message:
-----------
Fix for uninitialized results from hsv_to_rgb, when hue is out of range 0..1.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_color.c

Modified: trunk/blender/source/blender/blenlib/intern/math_color.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_color.c    2010-07-17 
18:40:00 UTC (rev 30447)
+++ trunk/blender/source/blender/blenlib/intern/math_color.c    2010-07-17 
21:01:00 UTC (rev 30448)
@@ -33,17 +33,14 @@
        int i;
        float f, p, q, t;
 
-       h *= 360.0f;
-       
        if(s==0.0f) {
                *r = v;
                *g = v;
                *b = v;
        }
        else {
-               if(h== 360.0f) h = 0.0f;
-               
-               h /= 60.0f;
+               h= (h - floor(h))*6.0f;
+
                i = (int)floor(h);
                f = h - i;
                p = v*(1.0f-s);


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to