From 655eb8eabd7a2ba73d7bd7dedbd59ed6461c3989 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Tue, 19 Feb 2019 15:41:24 +0100 Subject: Fix T61690: Hidden curve vertices are drawn in edit-mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When hiding the curve handles/points previously, the control points would still be drawn (loose verts). Now we hide everything related to the handle if it is hidden. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D4373 --- source/blender/draw/intern/draw_cache_impl_curve.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/blender/draw/intern') diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index f41062d2018..aef24dd0a72 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -741,10 +741,14 @@ static void curve_create_edit_data_and_handles( const BPoint *bp = nu->bp; if (bezt) { for (int a = 0; a < nu->pntsu; a++, bezt++) { - if (elbp_verts && bezt->hide == false) { + if (bezt->hide == true) { + continue; + } + + if (elbp_verts) { GPU_indexbuf_add_point_vert(elbp_verts, vbo_len_used + 1); } - if (elbp_lines && bezt->hide == false) { + if (elbp_lines) { GPU_indexbuf_add_line_verts(elbp_lines, vbo_len_used + 1, vbo_len_used + 0); GPU_indexbuf_add_line_verts(elbp_lines, vbo_len_used + 1, vbo_len_used + 2); } @@ -770,14 +774,17 @@ static void curve_create_edit_data_and_handles( else if (bp) { int pt_len = nu->pntsu * nu->pntsv; for (int a = 0; a < pt_len; a++, bp++) { + if (bp->hide == true) { + continue; + } int u = (a % nu->pntsu); int v = (a / nu->pntsu); /* Use indexed rendering for bezier. * Specify all points and use indices to hide/show. */ - if (elbp_verts && bp->hide == false) { + if (elbp_verts) { GPU_indexbuf_add_point_vert(elbp_verts, vbo_len_used); } - if (elbp_lines && bp->hide == false) { + if (elbp_lines) { const BPoint *bp_next_u = (u < (nu->pntsu - 1)) ? &nu->bp[a + 1] : NULL; const BPoint *bp_next_v = (v < (nu->pntsv - 1)) ? &nu->bp[a + nu->pntsu] : NULL; if (bp_next_u && (bp_next_u->hide == false)) { -- cgit v1.2.3