From 992ac8f94252cb3a1b3bd68bdd0d88b0af4eabba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 Jan 2018 00:43:45 +1100 Subject: Fix for fix w/ GPU_batch_wire_from_poly_2d_encoded Was missing first edge --- source/blender/gpu/intern/gpu_batch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index baf24c95881..0400fc1025b 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -215,8 +215,12 @@ Gwn_Batch *GPU_batch_wire_from_poly_2d_encoded( { qsort(lines, lines_len, sizeof(int32_t), BLI_sortutil_cmp_int); lines_step = lines; + + if (lines[0] != lines[1]) { + *lines_step++ = lines[0]; + } for (uint i_prev = 0, i = 1; i < lines_len; i_prev = i++) { - if ((lines[i] != lines[i_prev])) { + if (lines[i] != lines[i_prev]) { *lines_step++ = lines[i]; } } -- cgit v1.2.3