diff options
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 21b0ed99f0b..a51fef6c692 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -217,7 +217,6 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot) static int graphkeys_viewall(bContext *C, const short do_sel_only, const short include_handles) { bAnimContext ac; - float extra; rctf cur_new; /* get editor data */ @@ -230,13 +229,7 @@ static int graphkeys_viewall(bContext *C, const short do_sel_only, const short i &cur_new.ymin, &cur_new.ymax, do_sel_only, include_handles); - extra = 0.1f * BLI_rctf_size_x(&cur_new); - cur_new.xmin -= extra; - cur_new.xmax += extra; - - extra = 0.1f * BLI_rctf_size_y(&cur_new); - cur_new.ymin -= extra; - cur_new.ymax += extra; + BLI_rctf_scale(&cur_new, 1.1f); UI_view2d_smooth_view(C, ac.ar, &cur_new); @@ -616,7 +609,7 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; ARegion *ar; @@ -632,8 +625,8 @@ static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, wmEvent *e ar = ac.ar; v2d = &ar->v2d; - mval[0] = (evt->x - ar->winrct.xmin); - mval[1] = (evt->y - ar->winrct.ymin); + mval[0] = (event->x - ar->winrct.xmin); + mval[1] = (event->y - ar->winrct.ymin); UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); @@ -842,7 +835,7 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { graphkeys_duplicate_exec(C, op); @@ -1197,7 +1190,7 @@ static int graphkeys_sound_bake_exec(bContext *UNUSED(C), wmOperator *op) #endif //WITH_AUDASPACE -static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; @@ -2139,7 +2132,7 @@ void GRAPH_OT_smooth(wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ /* present a special customised popup menu for this, with some filtering */ -static int graph_fmodifier_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int graph_fmodifier_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { wmOperatorType *ot = WM_operatortype_find("GRAPH_OT_fmodifier_add", 1); uiPopupMenu *pup; @@ -2203,8 +2196,9 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) /* add F-Modifier of specified type to active F-Curve, and make it the active one */ fcm = add_fmodifier(&fcu->modifiers, type); - if (fcm) + if (fcm) { set_active_fmodifier(&fcu->modifiers, fcm); + } else { BKE_report(op->reports, RPT_ERROR, "Modifier could not be added (see console for details)"); break; |