Fix T41415: Lasso keymap not working in UV editor.

Extend option was not implemented for UV lasso select...
This commit is contained in:
Bastien Montagne 2014-08-12 20:12:01 +02:00
parent 7c7cb01aa5
commit 4bd252d8c3
Notes: blender-bot 2023-02-14 10:14:07 +01:00
Referenced by issue #41415, Lasso keymap not working in UV editor
1 changed files with 9 additions and 3 deletions

View File

@ -3036,7 +3036,8 @@ static void UV_OT_circle_select(wmOperatorType *ot)
/* ******************** lasso select operator **************** */
static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short moves, const bool select)
static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short moves,
const bool select, const bool extend)
{
SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = CTX_data_edit_image(C);
@ -3063,6 +3064,10 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo
BLI_lasso_boundbox(&rect, mcords, moves);
if (!extend && select) {
uv_select_all_perform(scene, ima, em, SEL_DESELECT);
}
if (use_face_center) { /* Face Center Sel */
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
BM_elem_flag_disable(efa, BM_ELEM_TAG);
@ -3125,11 +3130,12 @@ static int uv_lasso_select_exec(bContext *C, wmOperator *op)
const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
bool select;
bool select, extend;
bool changed;
select = !RNA_boolean_get(op->ptr, "deselect");
changed = do_lasso_select_mesh_uv(C, mcords, mcords_tot, select);
extend = RNA_boolean_get(op->ptr, "extend");
changed = do_lasso_select_mesh_uv(C, mcords, mcords_tot, select, extend);
MEM_freeN((void *)mcords);