Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-03-06 18:56:42 +0300
committerJulian Eisel <julian@blender.org>2020-03-06 19:19:23 +0300
commitb2ee1770d4c31078518f4ec9edd5196a41345162 (patch)
tree6b7f6ff9057322245fc3b3407bece3f1c0cb3eb5 /source/blender/editors/curve
parentb825a95ec311a169d33fe21e28418f11a516c82f (diff)
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.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c4
-rw-r--r--source/blender/editors/curve/editcurve_paint.c31
-rw-r--r--source/blender/editors/curve/editfont.c2
3 files changed, 20 insertions, 17 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a37063a076d..ee1a48e9f1e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -5671,13 +5671,13 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
copy_v3_v3(location, vc.scene->cursor.location);
}
- ED_view3d_win_to_3d_int(vc.v3d, vc.ar, location, event->mval, location);
+ ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, location);
if (use_proj) {
const float mval[2] = {UNPACK2(event->mval)};
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
- vc.bmain, vc.scene, vc.depsgraph, 0, vc.ar, vc.v3d);
+ vc.bmain, vc.scene, vc.depsgraph, 0, vc.region, vc.v3d);
ED_transform_snap_object_project_view3d(
snap_context,
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 5486d60d5d7..f97214991ef 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -187,7 +187,7 @@ static bool stroke_elem_project(const struct CurveDrawData *cdd,
float r_location_world[3],
float r_normal_world[3])
{
- ARegion *ar = cdd->vc.ar;
+ ARegion *region = cdd->vc.region;
RegionView3D *rv3d = cdd->vc.rv3d;
bool is_location_world_set = false;
@@ -195,7 +195,8 @@ static bool stroke_elem_project(const struct CurveDrawData *cdd,
/* project to 'location_world' */
if (cdd->project.use_plane) {
/* get the view vector to 'location' */
- if (ED_view3d_win_to_3d_on_plane(ar, cdd->project.plane, mval_fl, true, r_location_world)) {
+ if (ED_view3d_win_to_3d_on_plane(
+ region, cdd->project.plane, mval_fl, true, r_location_world)) {
if (r_normal_world) {
zero_v3(r_normal_world);
}
@@ -207,7 +208,7 @@ static bool stroke_elem_project(const struct CurveDrawData *cdd,
if (depths && ((unsigned int)mval_i[0] < depths->w) && ((unsigned int)mval_i[1] < depths->h)) {
const double depth = (double)ED_view3d_depth_read_cached(&cdd->vc, mval_i);
if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
- if (ED_view3d_depth_unproject(ar, mval_i, depth, r_location_world)) {
+ if (ED_view3d_depth_unproject(region, mval_i, depth, r_location_world)) {
is_location_world_set = true;
if (r_normal_world) {
zero_v3(r_normal_world);
@@ -252,7 +253,7 @@ static bool stroke_elem_project_fallback(const struct CurveDrawData *cdd,
cdd, mval_i, mval_fl, surface_offset, radius, r_location_world, r_normal_world);
if (is_depth_found == false) {
ED_view3d_win_to_3d(
- cdd->vc.v3d, cdd->vc.ar, location_fallback_depth, mval_fl, r_location_world);
+ cdd->vc.v3d, cdd->vc.region, location_fallback_depth, mval_fl, r_location_world);
zero_v3(r_normal_local);
}
mul_v3_m4v3(r_location_local, cdd->vc.obedit->imat, r_location_world);
@@ -345,7 +346,9 @@ static void curve_draw_stroke_from_operator(wmOperator *op)
/** \name Operator Callbacks & Helpers
* \{ */
-static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg)
+static void curve_draw_stroke_3d(const struct bContext *UNUSED(C),
+ ARegion *UNUSED(region),
+ void *arg)
{
wmOperator *op = arg;
struct CurveDrawData *cdd = op->customdata;
@@ -502,7 +505,7 @@ static void curve_draw_event_add(wmOperator *op, const wmEvent *event)
cdd->prev.selem = selem;
- ED_region_tag_redraw(cdd->vc.ar);
+ ED_region_tag_redraw(cdd->vc.region);
}
static void curve_draw_event_add_first(wmOperator *op, const wmEvent *event)
@@ -572,7 +575,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
if (is_invoke) {
ED_view3d_viewcontext_init(C, &cdd->vc, depsgraph);
- if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) {
+ if (ELEM(NULL, cdd->vc.region, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) {
MEM_freeN(cdd);
BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport");
return false;
@@ -610,7 +613,7 @@ static void curve_draw_exit(wmOperator *op)
struct CurveDrawData *cdd = op->customdata;
if (cdd) {
if (cdd->draw_handle_view) {
- ED_region_draw_cb_exit(cdd->vc.ar->type, cdd->draw_handle_view);
+ ED_region_draw_cb_exit(cdd->vc.region->type, cdd->draw_handle_view);
WM_cursor_modal_restore(cdd->vc.win);
}
@@ -1052,12 +1055,12 @@ static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const float mval_fl[2] = {UNPACK2(event->mval)};
float center[3];
negate_v3_v3(center, cdd->vc.rv3d->ofs);
- ED_view3d_win_to_3d(cdd->vc.v3d, cdd->vc.ar, center, mval_fl, cdd->prev.location_world);
+ ED_view3d_win_to_3d(cdd->vc.v3d, cdd->vc.region, center, mval_fl, cdd->prev.location_world);
copy_v3_v3(cdd->prev.location_world_valid, cdd->prev.location_world);
}
cdd->draw_handle_view = ED_region_draw_cb_activate(
- cdd->vc.ar->type, curve_draw_stroke_3d, op, REGION_DRAW_POST_VIEW);
+ cdd->vc.region->type, curve_draw_stroke_3d, op, REGION_DRAW_POST_VIEW);
WM_cursor_modal_set(cdd->vc.win, WM_CURSOR_PAINT_BRUSH);
{
@@ -1080,13 +1083,13 @@ static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* needed or else the draw matrix can be incorrect */
view3d_operator_needs_opengl(C);
- ED_view3d_autodist_init(cdd->vc.depsgraph, cdd->vc.ar, cdd->vc.v3d, 0);
+ ED_view3d_autodist_init(cdd->vc.depsgraph, cdd->vc.region, cdd->vc.v3d, 0);
if (cdd->vc.rv3d->depths) {
cdd->vc.rv3d->depths->damaged = true;
}
- ED_view3d_depth_update(cdd->vc.ar);
+ ED_view3d_depth_update(cdd->vc.region);
if (cdd->vc.rv3d->depths != NULL) {
cdd->project.use_depth = true;
@@ -1140,7 +1143,7 @@ static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (event->type == cdd->init_event_type) {
if (event->val == KM_RELEASE) {
- ED_region_tag_redraw(cdd->vc.ar);
+ ED_region_tag_redraw(cdd->vc.region);
curve_draw_exec_precalc(op);
@@ -1152,7 +1155,7 @@ static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
}
else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
- ED_region_tag_redraw(cdd->vc.ar);
+ ED_region_tag_redraw(cdd->vc.region);
curve_draw_cancel(C, op);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index d1ff4cec763..1f57c6cfe0a 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -2256,7 +2256,7 @@ bool ED_curve_editfont_select_pick(
for (j = 0; j < 4; j++) {
if (ED_view3d_project_float_object(
- vc.ar, obedit_co[j], screen_co[j], V3D_PROJ_TEST_CLIP_BB) == V3D_PROJ_RET_OK) {
+ vc.region, obedit_co[j], screen_co[j], V3D_PROJ_TEST_CLIP_BB) == V3D_PROJ_RET_OK) {
project_ok |= (1 << j);
}
}