[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13553] trunk/blender/source/blender/src/ interface_draw.c: * Change to the 'active line' drawing in colourbands.

Matt Ebb matt at mke3.net
Mon Feb 4 01:14:06 CET 2008


Revision: 13553
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13553
Author:   broken
Date:     2008-02-04 01:14:06 +0100 (Mon, 04 Feb 2008)

Log Message:
-----------
* Change to the 'active line' drawing in colourbands. The wide strip was always ugly, inaccurate and jumped around. Now it uses a finely dashed line.

Modified Paths:
--------------
    trunk/blender/source/blender/src/interface_draw.c

Modified: trunk/blender/source/blender/src/interface_draw.c
===================================================================
--- trunk/blender/source/blender/src/interface_draw.c	2008-02-04 00:03:38 UTC (rev 13552)
+++ trunk/blender/source/blender/src/interface_draw.c	2008-02-04 00:14:06 UTC (rev 13553)
@@ -1970,7 +1970,7 @@
 	ColorBand *coba= (ColorBand *)but->poin;
 	CBData *cbd;
 	float x1, y1, sizex, sizey;
-	float dx, v3[2], v1[2], v2[2];
+	float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2];
 	int a;
 		
 	if(coba==NULL) return;
@@ -2038,39 +2038,55 @@
 	/* help lines */
 	v1[0]= v2[0]=v3[0]= x1;
 	v1[1]= y1;
+	v1a[1]= y1+0.25*sizey;
 	v2[1]= y1+0.5*sizey;
+	v2a[1]= y1+0.75*sizey;
 	v3[1]= y1+sizey;
 	
+	
 	cbd= coba->data;
 	glBegin(GL_LINES);
 	for(a=0; a<coba->tot; a++, cbd++) {
-		v1[0]=v2[0]=v3[0]= x1+ cbd->pos*sizex;
+		v1[0]=v2[0]=v3[0]=v1a[0]=v2a[0]= x1+ cbd->pos*sizex;
 		
-		glColor3ub(0, 0, 0);
-		glVertex2fv(v1);
-		glVertex2fv(v2);
-		
 		if(a==coba->cur) {
-			glVertex2f(v1[0]-1, v1[1]);
-			glVertex2f(v2[0]-1, v2[1]);
-			glVertex2f(v1[0]+1, v1[1]);
-			glVertex2f(v2[0]+1, v2[1]);
+			glColor3ub(0, 0, 0);
+			glVertex2fv(v1);
+			glVertex2fv(v3);
+			glEnd();
+			
+			setlinestyle(2);
+			glBegin(GL_LINES);
+			glColor3ub(255, 255, 255);
+			glVertex2fv(v1);
+			glVertex2fv(v3);
+			glEnd();
+			setlinestyle(0);
+			glBegin(GL_LINES);
+			
+			/* glColor3ub(0, 0, 0);
+			glVertex2fv(v1);
+			glVertex2fv(v1a);
+			glColor3ub(255, 255, 255);
+			glVertex2fv(v1a);
+			glVertex2fv(v2);
+			glColor3ub(0, 0, 0);
+			glVertex2fv(v2);
+			glVertex2fv(v2a);
+			glColor3ub(255, 255, 255);
+			glVertex2fv(v2a);
+			glVertex2fv(v3);
+			*/
 		}
-		
-		glColor3ub(255, 255, 255);
-		glVertex2fv(v2);
-		glVertex2fv(v3);
-		
-		if(a==coba->cur) {
-			if(cbd->pos>0.01) {
-				glVertex2f(v2[0]-1, v2[1]);
-				glVertex2f(v3[0]-1, v3[1]);
-			}
-			if(cbd->pos<0.99) {
-				glVertex2f(v2[0]+1, v2[1]);
-				glVertex2f(v3[0]+1, v3[1]);
-			}
-		}
+		else {
+			glColor3ub(0, 0, 0);
+			glVertex2fv(v1);
+			glVertex2fv(v2);
+			
+			glColor3ub(255, 255, 255);
+			glVertex2fv(v2);
+			glVertex2fv(v3);
+		}	
 	}
 	glEnd();
 }





More information about the Bf-blender-cvs mailing list