diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-01 02:56:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-01 03:18:17 +0300 |
commit | eb0f8317e231c4a02940d0269125a96a47e94c7e (patch) | |
tree | 03c67854c72c5a4507f22f8c2321c14b2629fccd /source/blender/editors/sculpt_paint/paint_utils.c | |
parent | ae6400cfb4cae798667eab903d9c463fdec31298 (diff) |
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index d470e6a3050..31b965c6a92 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -130,13 +130,12 @@ float paint_calc_object_space_radius(ViewContext *vc, const float center[3], flo { Object *ob = vc->obact; float delta[3], scale, loc[3]; - const float mval_f[2] = {pixel_radius, 0.0f}; - float zfac; + const float xy_delta[2] = {pixel_radius, 0.0f}; mul_v3_m4v3(loc, ob->obmat, center); - zfac = ED_view3d_calc_zfac(vc->rv3d, loc, NULL); - ED_view3d_win_to_delta(vc->region, mval_f, delta, zfac); + const float zfac = ED_view3d_calc_zfac(vc->rv3d, loc); + ED_view3d_win_to_delta(vc->region, xy_delta, zfac, delta); scale = fabsf(mat4_to_scale(ob->obmat)); scale = (scale == 0.0f) ? 1.0f : scale; |