diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-20 11:41:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-20 11:41:41 +0300 |
commit | da53eb3748b42a5d77e1074b767dbd64d79ccc4a (patch) | |
tree | 1d294d961d3d488feb91db49272150c2655c6139 /source/blender | |
parent | a3716f5945b4ea0451281e9ae4ba9e43d2793938 (diff) |
Manipulator: tweak shape drawing
Draw triangles over wire for a more subtle outline.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_manipulator_navigate.c | 1 |
2 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c index 2951ad84c0d..ce6992e7ad9 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c @@ -114,8 +114,8 @@ static void button2d_draw_intern( /* We shouldn't need the +1, but a NULL char is set. */ char *polys = MEM_mallocN(polys_len + 1, __func__); RNA_property_string_get(mpr->ptr, prop, polys); - button->shape_batch[0] = GPU_batch_tris_from_poly_2d_encoded((uchar *)polys, polys_len, NULL); - button->shape_batch[1] = GPU_batch_wire_from_poly_2d_encoded((uchar *)polys, polys_len, NULL); + button->shape_batch[0] = GPU_batch_wire_from_poly_2d_encoded((uchar *)polys, polys_len, NULL); + button->shape_batch[1] = GPU_batch_tris_from_poly_2d_encoded((uchar *)polys, polys_len, NULL); MEM_freeN(polys); } } @@ -137,17 +137,17 @@ static void button2d_draw_intern( glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); for (uint i = 0; i < ARRAY_SIZE(button->shape_batch) && button->shape_batch[i]; i++) { + /* Invert line color for wire. */ + color[0] = 1.0f - color[0]; + color[1] = 1.0f - color[1]; + color[2] = 1.0f - color[2]; + GWN_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR); GWN_batch_uniform_4f(button->shape_batch[i], "color", UNPACK4(color)); GWN_batch_draw(button->shape_batch[i]); - if (i == 0) { - /* Invert line color. */ - color[0] = 1.0f - color[0]; - color[1] = 1.0f - color[1]; - color[2] = 1.0f - color[2]; - } } glDisable(GL_POLYGON_SMOOTH); + glDisable(GL_LINE_SMOOTH); gpuPopMatrix(); } else if (button->icon != ICON_NONE) { diff --git a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c index 3fc3300e2c1..0f7df8fe6aa 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c @@ -201,7 +201,6 @@ static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmManipulatorG mpr->ptr, prop, (const char *)info->shape, info->shape_size); /* don't fade icons so much */ - copy_v3_fl(mpr->color, 0.0f); mpr->color[3] = 0.5f; } |