Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2009-11-10 07:02:44 +0300
committerMatt Ebb <matt@mke3.net>2009-11-10 07:02:44 +0300
commit84abb8ecb6a5594abd4f3bf028ba52088afde7bf (patch)
treeaac61c769ff93aaaf9e2954b859a7b396080fba9 /source
parentbc006655baf74ef0e22167a704899000b748c23f (diff)
Fix for [#19855] Color Ramp Interpolation is not working
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_draw.c14
1 files changed, 7 insertions, 7 deletions
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; 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);