From b2ee1770d4c31078518f4ec9edd5196a41345162 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 6 Mar 2020 16:56:42 +0100 Subject: Cleanup: Rename ARegion variables from ar to region The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files. --- source/blender/editors/space_graph/graph_edit.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/space_graph/graph_edit.c') diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 623d7e287d2..7580666c5f0 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -297,9 +297,9 @@ static int graphkeys_viewall(bContext *C, float pad_top = UI_TIME_SCRUB_MARGIN_Y; float pad_bottom = BLI_listbase_is_empty(ED_context_get_markers(C)) ? V2D_SCROLL_HANDLE_HEIGHT : UI_MARKER_MARGIN_Y; - BLI_rctf_pad_y(&cur_new, ac.ar->winy, pad_bottom, pad_top); + BLI_rctf_pad_y(&cur_new, ac.region->winy, pad_bottom, pad_top); - UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); + UI_view2d_smooth_view(C, ac.region, &cur_new, smooth_viewtx); return OPERATOR_FINISHED; } @@ -486,7 +486,7 @@ static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op) /* Ghost curves are snapshots of the visible portions of the curves, * so set range to be the visible range. */ - v2d = &ac.ar->v2d; + v2d = &ac.region->v2d; start = (int)v2d->cur.xmin; end = (int)v2d->cur.xmax; @@ -871,7 +871,7 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; - ARegion *ar; + ARegion *region; View2D *v2d; int mval[2]; float x, y; @@ -882,11 +882,11 @@ static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, const wmEv } /* store mouse coordinates in View2D space, into the operator's properties */ - ar = ac.ar; - v2d = &ar->v2d; + region = ac.region; + v2d = ®ion->v2d; - mval[0] = (event->x - ar->winrct.xmin); - mval[1] = (event->y - ar->winrct.ymin); + mval[0] = (event->x - region->winrct.xmin); + mval[1] = (event->y - region->winrct.ymin); UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); @@ -1337,7 +1337,7 @@ typedef struct tDecimateGraphOp { bAnimContext ac; Scene *scene; ScrArea *sa; - ARegion *ar; + ARegion *region; /** A 0-1 value for determining how much we should decimate. */ PropertyRNA *percentage_prop; @@ -1460,7 +1460,7 @@ static void decimate_mouse_update_percentage(tDecimateGraphOp *dgo, wmOperator *op, const wmEvent *event) { - float percentage = (event->x - dgo->ar->winrct.xmin) / ((float)dgo->ar->winx); + float percentage = (event->x - dgo->region->winrct.xmin) / ((float)dgo->region->winx); RNA_property_float_set(op->ptr, dgo->percentage_prop, percentage); } @@ -1483,7 +1483,7 @@ static int graphkeys_decimate_invoke(bContext *C, wmOperator *op, const wmEvent dgo->scene = CTX_data_scene(C); dgo->sa = CTX_wm_area(C); - dgo->ar = CTX_wm_region(C); + dgo->region = CTX_wm_region(C); /* initialise percentage so that it will have the correct value before the first mouse move. */ decimate_mouse_update_percentage(dgo, op, event); -- cgit v1.2.3