[Bf-blender-cvs] [245c5d3] GPencil_EditStrokes: Drawing Test: Use theme setting for the base colour of unselected GP Verts when opacity < 1

Joshua Leung noreply at git.blender.org
Fri Oct 10 12:26:03 CEST 2014


Commit: 245c5d3d3a816639e0eb73c8077eb25dc820b937
Author: Joshua Leung
Date:   Fri Oct 10 13:04:47 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rB245c5d3d3a816639e0eb73c8077eb25dc820b937

Drawing Test: Use theme setting for the base colour of unselected GP Verts when opacity < 1

The intention here is that in this case, the unselected verts will no longer stand out
enough when full opacity is used, as they would all be the same colour.

===================================================================

M	source/blender/editors/gpencil/drawgpencil.c

===================================================================

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index c440292..813393d 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -604,8 +604,14 @@ static void gp_draw_strokes_edit(bGPDframe *gpf, int offsx, int offsy, int winx,
 		}
 		
 		/* First Pass: Draw all the verts (i.e. these become the unselected state) */
-		//UI_ThemeColor(TH_VERTEX);
-		glColor3fv(tcolor); /* for now, we assume that the base color of the points is not too close to the real color */
+		if (tcolor != NULL) {
+			/* for now, we assume that the base color of the points is not too close to the real color */
+			glColor3fv(tcolor);
+		}
+		else {
+			/* this doesn't work well with the default theme and black strokes... */
+			UI_ThemeColor(TH_VERTEX);
+		}
 		glPointSize(bsize);
 		
 		glBegin(GL_POINTS);
@@ -772,7 +778,8 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
 		 */
 		/* XXX: perhaps we don't want to show these when users are drawing... */
 		if ((gpl->flag & GP_LAYER_LOCKED) == 0) {
-			gp_draw_strokes_edit(gpf, offsx, offsy, winx, winy, dflag, tcolor);
+			gp_draw_strokes_edit(gpf, offsx, offsy, winx, winy, dflag, 
+			                     (gpl->color[3] < 0.95f) ? tcolor : NULL);
 		}
 		
 		/* Check if may need to draw the active stroke cache, only if this layer is the active layer




More information about the Bf-blender-cvs mailing list