From 84abb8ecb6a5594abd4f3bf028ba52088afde7bf Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 10 Nov 2009 04:02:44 +0000 Subject: Fix for [#19855] Color Ramp Interpolation is not working --- source/blender/editors/interface/interface_draw.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index cded4753f61..59a1933fa4a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -656,6 +656,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) 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 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) v1[0]+= dx; } - glShadeModel(GL_SMOOTH); + glShadeModel(GL_FLAT); glEnable(GL_BLEND); cbd= coba->data; @@ -690,17 +691,16 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) glColor4fv( &cbd->r ); glVertex2fv(v1); glVertex2fv(v2); - for(a=0; atot; 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); -- cgit v1.2.3