Revision: 24441
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24441
Author:   broken
Date:     2009-11-10 05:02:44 +0100 (Tue, 10 Nov 2009)

Log Message:
-----------
Fix for [#19855] Color Ramp Interpolation is not working

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_draw.c

Modified: trunk/blender/source/blender/editors/interface/interface_draw.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_draw.c     
2009-11-10 04:01:44 UTC (rev 24440)
+++ trunk/blender/source/blender/editors/interface/interface_draw.c     
2009-11-10 04:02:44 UTC (rev 24441)
@@ -656,6 +656,7 @@
        float x1, y1, sizex, sizey;
        float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2];
        int a;
+       float pos, colf[4];
                
        coba= (ColorBand *)(but->editcoba? but->editcoba: but->poin);
        if(coba==NULL) return;
@@ -676,7 +677,7 @@
                v1[0]+= dx;
        }
        
-       glShadeModel(GL_SMOOTH);
+       glShadeModel(GL_FLAT);
        glEnable(GL_BLEND);
        
        cbd= coba->data;
@@ -690,17 +691,16 @@
        glColor4fv( &cbd->r );
        glVertex2fv(v1); glVertex2fv(v2);
        
-       for(a=0; a<coba->tot; a++, cbd++) {
+       for( a = 1; a < sizex; a++ ) {
+               pos = ((float)a) / (sizex-1);
+               do_colorband( coba, pos, colf );
                
-               v1[0]=v2[0]= x1+ cbd->pos*sizex;
+               v1[0]=v2[0]= x1 + a;
                
-               glColor4fv( &cbd->r );
+               glColor4fv( colf );
                glVertex2fv(v1); glVertex2fv(v2);
        }
        
-       v1[0]=v2[0]= x1+ sizex;
-       glVertex2fv(v1); glVertex2fv(v2);
-       
        glEnd();
        glShadeModel(GL_FLAT);
        glDisable(GL_BLEND);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to