diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-02-19 17:41:24 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-02-19 17:45:40 +0300 |
commit | 655eb8eabd7a2ba73d7bd7dedbd59ed6461c3989 (patch) | |
tree | f36470f9eb4f816f557771c12520f77e6a8df517 /source/blender/draw/intern/draw_cache_impl_curve.c | |
parent | 38f0d5f75af7d2f30156f4008dc5bc8d8394fbf3 (diff) |
Fix T61690: Hidden curve vertices are drawn in edit-mode
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
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_curve.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curve.c | 15 |
1 files changed, 11 insertions, 4 deletions
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)) { |