[Bf-blender-cvs] [4bd252d] master: Fix T41415: Lasso keymap not working in UV editor.
Bastien Montagne
noreply at git.blender.org
Tue Aug 12 20:13:04 CEST 2014
Commit: 4bd252d8c3924361782998760523e25452594d21
Author: Bastien Montagne
Date: Tue Aug 12 20:12:01 2014 +0200
Branches: master
https://developer.blender.org/rB4bd252d8c3924361782998760523e25452594d21
Fix T41415: Lasso keymap not working in UV editor.
Extend option was not implemented for UV lasso select...
===================================================================
M source/blender/editors/uvedit/uvedit_ops.c
===================================================================
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 0d8b5a5..4b34154 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -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);
More information about the Bf-blender-cvs
mailing list