[Bf-blender-cvs] [b8475a1d4c7] greasepencil-object: Replace reverse findlink

Antonio Vazquez noreply at git.blender.org
Wed Jan 10 19:24:52 CET 2018


Commit: b8475a1d4c713621cdc3c8f8e3643fa859cf02b5
Author: Antonio Vazquez
Date:   Wed Jan 10 14:20:28 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb8475a1d4c713621cdc3c8f8e3643fa859cf02b5

Replace reverse findlink

Fix error in previous commit using reverse find

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

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 c6baaa7a433..a3cc9d6486b 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -224,10 +224,10 @@ static tGPDpick *gp_session_init_colorpick(bContext *C, wmOperator *op)
 
 	/* load color table */
 	tGPDpickColor *col = tgpk->colors;
-	int idx = tgpk->totcolor - 1;
+	int idx = 0;
 	for (int r = 0; r < tgpk->row; r++) {
 		for (int c = 0; c < tgpk->col; c++, col++) {
-			PaletteColor *palcol = BLI_rfindlink(&tgpk->palette->colors, idx);
+			PaletteColor *palcol = BLI_findlink(&tgpk->palette->colors, idx);
 			
 			/* exit if colors completed */
 			if (!palcol) {
@@ -250,7 +250,7 @@ static tGPDpick *gp_session_init_colorpick(bContext *C, wmOperator *op)
 			col->rect.ymax = tgpk->panel.ymax - (tgpk->boxsize[1] * r) - GP_BOX_GAP;
 			col->rect.ymin = col->rect.ymax - tgpk->boxsize[0] + (GP_BOX_GAP * 2);
 
-			idx--;
+			idx++;
 		}
 	}



More information about the Bf-blender-cvs mailing list