diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-25 07:40:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-25 07:40:43 +0300 |
commit | b67c3a0db9173ac400b1d0593a72f2aa23c66bab (patch) | |
tree | c660321e6484a42fa3f578e122ed320546f4d062 /source/blender/editors/gizmo_library | |
parent | f3cff06087c717669e28c60adbac13deca939645 (diff) |
Gizmo: add option to move & dial gizmos to select as filled
Draw as an outline while using solid selection.
Diffstat (limited to 'source/blender/editors/gizmo_library')
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c | 12 | ||||
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index b5be45bb63f..9072ced0bd1 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -106,7 +106,11 @@ static void dial_geom_draw( UNUSED_VARS(gz, axis_modal_mat, clip_plane); wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_dial, select, color); #else - const bool filled = (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_FILL) != 0; + const bool filled = ( + (draw_options & + (select ? + (ED_GIZMO_DIAL_DRAW_FLAG_FILL | ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT) : + ED_GIZMO_DIAL_DRAW_FLAG_FILL))); GPU_line_width(line_width); @@ -368,7 +372,7 @@ static void dial_draw_intern( } ED_gizmotypes_dial_3d_draw_util( - gz->matrix_basis, matrix_final, gz->line_width, color, + gz->matrix_basis, matrix_final, gz->line_width, color, select, &(struct Dial3dParams){ .draw_options = draw_options, .angle_ofs = angle_ofs, @@ -536,6 +540,7 @@ void ED_gizmotypes_dial_3d_draw_util( const float matrix_final[4][4], const float line_width, const float color[4], + const bool select, struct Dial3dParams *params) { GPU_matrix_push(); @@ -562,7 +567,7 @@ void ED_gizmotypes_dial_3d_draw_util( /* Draw actual dial gizmo. */ dial_geom_draw( - color, line_width, false, matrix_basis, params->clip_plane, + color, line_width, select, matrix_basis, params->clip_plane, params->arc_partial_angle, params->arc_inner_factor, params->draw_options); GPU_matrix_pop(); @@ -587,6 +592,7 @@ static void GIZMO_GT_dial_3d(wmGizmoType *gzt) static EnumPropertyItem rna_enum_draw_options[] = { {ED_GIZMO_DIAL_DRAW_FLAG_CLIP, "CLIP", 0, "Clipped", ""}, {ED_GIZMO_DIAL_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""}, + {ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT, "FILL_SELECT", 0, "Use fill for selection test", ""}, {ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR, "ANGLE_MIRROR", 0, "Angle Mirror", ""}, {ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y, "ANGLE_START_Y", 0, "Angle Start Y", ""}, {ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE, "ANGLE_VALUE", 0, "Show Angle Value", ""}, diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index 0fe5a4e7d80..3870ce984b5 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -104,7 +104,11 @@ static void move_geom_draw( wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_move3d, select); #else const int draw_style = RNA_enum_get(gz->ptr, "draw_style"); - const bool filled = (draw_options & ED_GIZMO_MOVE_DRAW_FLAG_FILL) != 0; + const bool filled = ( + (draw_options & + (select ? + (ED_GIZMO_MOVE_DRAW_FLAG_FILL | ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT) : + ED_GIZMO_MOVE_DRAW_FLAG_FILL))); GPU_line_width(gz->line_width); @@ -440,6 +444,7 @@ static void GIZMO_GT_move_3d(wmGizmoType *gzt) }; static EnumPropertyItem rna_enum_draw_options[] = { {ED_GIZMO_MOVE_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""}, + {ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT, "FILL_SELECT", 0, "Use fill for selection test", ""}, {ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW, "ALIGN_VIEW", 0, "Align View", ""}, {0, NULL, 0, NULL, NULL}, }; |