diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_mask_expand.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_mask_expand.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_mask_expand.c b/source/blender/editors/sculpt_paint/sculpt_mask_expand.c index 0ae9baf7e2e..5a921383ac3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_mask_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_mask_expand.c @@ -188,8 +188,14 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent * float mouse[2]; mouse[0] = event->mval[0]; mouse[1] = event->mval[1]; - SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false); - mask_expand_update_it = ss->filter_cache->mask_update_it[(int)SCULPT_active_vertex_get(ss)]; + if (SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false)) { + /* The cursor is over the mesh, get the update iteration from the updated active vertex. */ + mask_expand_update_it = ss->filter_cache->mask_update_it[(int)SCULPT_active_vertex_get(ss)]; + } + else { + /* When the cursor is outside the mesh, affect the entire connected component. */ + mask_expand_update_it = ss->filter_cache->mask_update_last_it - 1; + } } if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) || @@ -213,7 +219,7 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent * /* Pivot position. */ if (RNA_boolean_get(op->ptr, "update_pivot")) { - const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); const float threshold = 0.2f; float avg[3]; int total = 0; |