Fix T102052 GPencil: stroke outline glitches in object mode

Was caused by an extra point per stroke being drawn.
This commit is contained in:
Clément Foucault
2022-10-25 16:12:17 +02:00
parent ffdb41a8bc
commit 7522c05076

View File

@@ -234,8 +234,8 @@ static void gpencil_stroke_cache_populate(bGPDlayer * /*gpl*/,
if (show_stroke) {
int vfirst = gps->runtime.stroke_start * 3;
/* Include "potential" cyclic vertex (see shader). */
int vcount = (gps->totpoints + 1) * 2 * 3;
bool is_cyclic = ((gps->flag & GP_STROKE_CYCLIC) != 0) && (gps->totpoints > 2);
int vcount = (gps->totpoints + (int)is_cyclic) * 2 * 3;
DRW_shgroup_call_range(iter->stroke_grp, iter->ob, geom, vfirst, vcount);
}
}