diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 20:32:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 20:32:06 +0300 |
commit | 8109b13e8369418f81ffa4f362f40d4d2f783851 (patch) | |
tree | 42d741f98110ea3564fd28e774756faf60b05602 /source/blender/editors | |
parent | aec5fb98041a369d30c4f3c07981169a2e12a5ae (diff) |
- converted circle select use a modal map
- now works exactly like 2.4x, except that its accessed from the CKey
- hack to remember circle size, need some better way to do this
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 13 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 7 |
2 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 0c90347063f..04658df3861 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1917,17 +1917,20 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) int x= RNA_int_get(op->ptr, "x"); int y= RNA_int_get(op->ptr, "y"); int radius= RNA_int_get(op->ptr, "radius"); + int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); + int selecting; + selecting= (gesture_mode==GESTURE_MODAL_SELECT); + if(CTX_data_edit_object(C) || (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) { ViewContext vc; - short mval[2], selecting; + short mval[2]; view3d_operator_needs_opengl(C); view3d_set_viewcontext(C, &vc); mval[0]= x; mval[1]= y; - selecting= LEFTMOUSE==RNA_int_get(op->ptr, "event_type"); // XXX solve if(CTX_data_edit_object(C)) { obedit_circle_select(&vc, selecting, mval, (float)radius); @@ -1938,7 +1941,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) } else { Base *base; - + selecting= selecting?BA_SELECT:BA_DESELECT; for(base= FIRSTBASE; base; base= base->next) { if(base->lay & v3d->lay) { project_short(ar, base->object->obmat[3], &base->sx); @@ -1946,7 +1949,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) int dx= base->sx-x; int dy= base->sy-y; if( dx*dx + dy*dy < radius*radius) - ED_base_object_select(base, BA_SELECT); + ED_base_object_select(base, selecting); } } } @@ -1974,5 +1977,5 @@ void VIEW3D_OT_select_circle(wmOperatorType *ot) RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "radius", 0, INT_MIN, INT_MAX, "Radius", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 460f9970861..47f10ce7aa8 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2205,9 +2205,10 @@ int circle_select_exec(bContext *C, wmOperator *op) MTFace *tface; int x, y, radius, width, height, select; float zoomx, zoomy, offset[2], ellipse[2]; - + int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); + /* get operator properties */ - select= (RNA_int_get(op->ptr, "event_type") == LEFTMOUSE); // XXX hardcoded + select= (gesture_mode == GESTURE_MODAL_SELECT); x= RNA_int_get(op->ptr, "x"); y= RNA_int_get(op->ptr, "y"); radius= RNA_int_get(op->ptr, "radius"); @@ -2261,7 +2262,7 @@ void UV_OT_circle_select(wmOperatorType *ot) RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "radius", 0, INT_MIN, INT_MAX, "Radius", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); } /* ******************** snap cursor operator **************** */ |