diff options
Diffstat (limited to 'source/blender/editors/space_nla/nla_select.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index d75c1aa7dd3..8ef63b9a83d 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -333,6 +333,7 @@ void NLA_OT_select_border(wmOperatorType *ot) ot->invoke= WM_border_select_invoke; ot->exec= nlaedit_borderselect_exec; ot->modal= WM_border_select_modal; + ot->cancel= WM_border_select_cancel; ot->poll= nlaop_poll_tweakmode_off; @@ -459,16 +460,10 @@ static int nlaedit_select_leftright_invoke (bContext *C, wmOperator *op, wmEvent Scene *scene= ac.scene; ARegion *ar= ac.ar; View2D *v2d= &ar->v2d; - - int mval[2]; float x; - /* get mouse coordinates (in region coordinates) */ - mval[0]= (event->x - ar->winrct.xmin); - mval[1]= (event->y - ar->winrct.ymin); - /* determine which side of the current frame mouse is on */ - UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, NULL); + UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, NULL); if (x < CFRA) RNA_int_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT); else @@ -503,7 +498,7 @@ void NLA_OT_select_leftright (wmOperatorType *ot) /* ******************** Mouse-Click Select Operator *********************** */ /* select strip directly under mouse */ -static void mouse_nla_strips (bContext *C, bAnimContext *ac, int mval[2], short select_mode) +static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2], short select_mode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale = NULL; @@ -612,10 +607,9 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even bAnimContext ac; Scene *scene; ARegion *ar; - View2D *v2d; + // View2D *v2d; /*UNUSED*/ short selectmode; - int mval[2]; - + /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; @@ -623,12 +617,8 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even /* get useful pointers from animation context data */ scene= ac.scene; ar= ac.ar; - v2d= &ar->v2d; - - /* get mouse coordinates (in region coordinates) */ - mval[0]= (event->x - ar->winrct.xmin); - mval[1]= (event->y - ar->winrct.ymin); - + // v2d= &ar->v2d; + /* select mode is either replace (deselect all, then add) or add/extend */ if (RNA_boolean_get(op->ptr, "extend")) selectmode= SELECT_INVERT; @@ -636,7 +626,7 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even selectmode= SELECT_REPLACE; /* select strips based upon mouse position */ - mouse_nla_strips(C, &ac, mval, selectmode); + mouse_nla_strips(C, &ac, event->mval, selectmode); /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL); |