diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-15 08:28:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-15 08:33:42 +0300 |
commit | bf8b62e874877b4bbe32c19b84bdc937320176ea (patch) | |
tree | 5b059aa1a7bbe43213e8562c0f6c197271893460 /source/blender/draw/intern/draw_cache_impl_curve.c | |
parent | 24d77e7db727c938e374655eec702a8162decf67 (diff) |
Fix curve handle color ID display
Regression in 49f59092e7c8c caused all handles to display using
the 'aligned' theme color.
Arrange flags to fix this, add assert to avoid this happening again.
Also rename flag so it's use is clearer.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_curve.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curve.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index c6112994b65..8798549a416 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -47,6 +47,7 @@ #include "draw_cache_impl.h" /* own include */ +/* See: edit_curve_point_vert.glsl for duplicate includes. */ #define SELECT 1 #define ACTIVE_NURB 1 << 2 #define BEZIER_HANDLE 1 << 3 @@ -698,7 +699,9 @@ static char beztriple_vflag_get(CurveRenderData *rdata, SET_FLAG_FROM_TEST(vflag, (v_idx == rdata->actvert && nu_id == rdata->actnu), VFLAG_VERT_ACTIVE); SET_FLAG_FROM_TEST(vflag, (nu_id == rdata->actnu), ACTIVE_NURB); SET_FLAG_FROM_TEST(vflag, handle_point, BEZIER_HANDLE); - SET_FLAG_FROM_TEST(vflag, handle_selected, VFLAG_HANDLE_SELECTED); + SET_FLAG_FROM_TEST(vflag, handle_selected, VFLAG_VERT_SELECTED_BEZT_HANDLE); + /* Setting flags that overlap with will cause the color id not to work properly. */ + BLI_assert((vflag >> COLOR_SHIFT) == 0); /* handle color id */ vflag |= col_id << COLOR_SHIFT; return vflag; @@ -711,6 +714,8 @@ static char bpoint_vflag_get(CurveRenderData *rdata, char flag, int v_idx, int n SET_FLAG_FROM_TEST(vflag, (v_idx == rdata->actvert && nu_id == rdata->actnu), VFLAG_VERT_ACTIVE); SET_FLAG_FROM_TEST(vflag, (nu_id == rdata->actnu), ACTIVE_NURB); SET_FLAG_FROM_TEST(vflag, ((u % 2) == 0), EVEN_U_BIT); + /* Setting flags that overlap with will cause the color id not to work properly. */ + BLI_assert((vflag >> COLOR_SHIFT) == 0); vflag |= COLOR_NURB_ULINE_ID << COLOR_SHIFT; return vflag; } |