[Bf-blender-cvs] [f7a7a890391] greasepencil-object: Improve cyclic join

Antonio Vazquez noreply at git.blender.org
Sun Oct 15 19:27:47 CEST 2017


Commit: f7a7a890391e93da7e69affdf4c9ad24d1b8063f
Author: Antonio Vazquez
Date:   Sun Oct 15 19:27:35 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBf7a7a890391e93da7e69affdf4c9ad24d1b8063f

Improve cyclic join

The join of the first point was not perfect.

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

M	source/blender/draw/engines/gpencil/gpencil_geom.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c b/source/blender/draw/engines/gpencil/gpencil_geom.c
index af884d02fce..e9f07d9c274 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -135,8 +135,14 @@ Gwn_Batch *DRW_gpencil_get_stroke_geom(bGPDframe *gpf, bGPDstroke *gps, short th
 	for (int i = 0; i < totpoints; i++, pt++) {
 		/* first point for adjacency (not drawn) */
 		if (i == 0) {
-			gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
-			++idx;
+			if (gps->flag & GP_STROKE_CYCLIC && totpoints > 2) {
+				gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[totpoints - 1], idx, pos_id, color_id, thickness_id, thickness, ink);
+				++idx;
+			}
+			else {
+				gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
+				++idx;
+			}
 		}
 		/* set point */
 		gpencil_set_stroke_point(vbo, gpf->viewmatrix, pt, idx, pos_id, color_id, thickness_id, thickness, ink);



More information about the Bf-blender-cvs mailing list