diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2018-05-13 11:46:00 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2018-05-24 09:41:13 +0300 |
commit | 3e9b592b08b614e29acdfd7906f572953c528378 (patch) | |
tree | fc49193e972a56cee8e67f761492145850b7fa5a /source/blender/editors | |
parent | 54f2e58452bba1db8c50d26ca6999473fa45809d (diff) |
Fix Extend property of Lasso select tool in Mask editor not working
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3361
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 7ffd82e262c..8559be67ece 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -481,7 +481,7 @@ void MASK_OT_select_border(wmOperatorType *ot) WM_operator_properties_gesture_border_select(ot); } -static bool do_lasso_select_mask(bContext *C, const int mcords[][2], short moves, short select) +static bool do_lasso_select_mask(bContext *C, const int mcords[][2], short moves, bool select, bool extend) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -514,6 +514,10 @@ static bool do_lasso_select_mask(bContext *C, const int mcords[][2], short moves /* TODO: handles? */ /* TODO: uw? */ + if (MASKPOINT_ISSEL_ANY(point) && select && extend) { + continue; + } + float screen_co[2]; /* point in screen coords */ @@ -526,9 +530,13 @@ static bool do_lasso_select_mask(bContext *C, const int mcords[][2], short moves { BKE_mask_point_select_set(point, select); BKE_mask_point_select_set_handle(point, MASK_WHICH_HANDLE_BOTH, select); + changed = true; + } + else if (select && !extend) { + BKE_mask_point_select_set(point, false); + BKE_mask_point_select_set_handle(point, MASK_WHICH_HANDLE_BOTH, false); + changed = true; } - - changed = true; } } } @@ -548,10 +556,9 @@ static int clip_lasso_select_exec(bContext *C, wmOperator *op) const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot); if (mcords) { - short select; - - select = !RNA_boolean_get(op->ptr, "deselect"); - do_lasso_select_mask(C, mcords, mcords_tot, select); + const bool select = !RNA_boolean_get(op->ptr, "deselect"); + const bool extend = RNA_boolean_get(op->ptr, "extend"); + do_lasso_select_mask(C, mcords, mcords_tot, select, extend); MEM_freeN((void *)mcords); |