From eb0f8317e231c4a02940d0269125a96a47e94c7e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Mar 2022 10:56:28 +1100 Subject: Cleanup: ED_view3d_win_to_delta & ED_view3d_calc_zfac usage - Rename ED_view3d_win_to_delta `mval` argument to `xy_delta` as it as it was misleading since this is an screen-space offset not a region relative cursor position (typical use of the name `mval`). Also rename the variable passed to this function which also used the term `mval` in many places. - Re-order the output argument of ED_view3d_win_to_delta last. use an r_ prefix for return arguments. - Document how the `zfac` argument is intended to be used. - Split ED_view3d_calc_zfac into two functions as the `r_flip` argument was only used in some special cases. --- source/blender/editors/physics/particle_edit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 6307f6dc37f..fc815ebe682 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4684,7 +4684,7 @@ static int brush_edit_init(bContext *C, wmOperator *op) bedit->ob = ob; bedit->edit = edit; - bedit->zfac = ED_view3d_calc_zfac(region->regiondata, min, NULL); + bedit->zfac = ED_view3d_calc_zfac(region->regiondata, min); /* cache view depths and settings for re-use */ PE_set_view3d_data(C, &bedit->data); @@ -4757,7 +4757,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) switch (pset->brushtype) { case PE_BRUSH_COMB: { - const float mval_f[2] = {dx, dy}; + const float xy_delta[2] = {dx, dy}; data.mval = mval; data.rad = pe_brush_size_get(scene, brush); @@ -4771,7 +4771,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) invert_m4_m4(ob->imat, ob->obmat); - ED_view3d_win_to_delta(region, mval_f, vec, bedit->zfac); + ED_view3d_win_to_delta(region, xy_delta, bedit->zfac, vec); data.dvec = vec; foreach_mouse_hit_key(&data, brush_comb, selected); -- cgit v1.2.3