[Bf-blender-cvs] [68128483504] greasepencil-object: Fix error when use fill only colors

Antonio Vazquez noreply at git.blender.org
Thu Jan 11 16:47:50 CET 2018


Commit: 6812848350466b8b5a2774b5bb6e6a54b8bffe46
Author: Antonio Vazquez
Date:   Thu Jan 11 16:47:37 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6812848350466b8b5a2774b5bb6e6a54b8bffe46

Fix error when use fill only colors

The index of the color used was wrong.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index fde7a9f85ed..ff2f197b388 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -226,7 +226,7 @@ static void gpencil_draw_color_table(const bContext *UNUSED(C), tGPDpick *tgpk)
 	tGPDpickColor *col = tgpk->colors;
 	for (int i = 0; i < tgpk->totcolor; i++, col++) {
 		/* focus to current color */
-		if (tgpk->palette->active_color == i) {
+		if (tgpk->palette->active_color == col->index) {
 			gp_draw_fill_box(&col->rect, select, select, 2);
 		}
 		gp_draw_pattern_box(&col->rect, 0);
@@ -329,6 +329,7 @@ static tGPDpick *gp_session_init_colorpick(bContext *C, wmOperator *op)
 			if ((palcol->fill[3] < GPENCIL_ALPHA_OPACITY_THRESH) &&
 				((tgpk->brush->flag & GP_BRUSH_FILL_ALLOW_STROKEONLY) == 0))
 			{
+				idx++;
 				continue;
 			}
 		}



More information about the Bf-blender-cvs mailing list