diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-16 09:23:24 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-16 09:32:35 +0300 |
commit | 1064bf58c3e8fd28d55a09632046a3c008ca1f03 (patch) | |
tree | 686baeec3ad4380f9e825713b968d92d3553ee7f /source/blender/editors/sculpt_paint/sculpt_transform.c | |
parent | b19751bee21c6ba46b46e1286bfed56e52bfc1d2 (diff) |
Cleanup: differentiate region/screen relative coordinates
- Avoid ambiguity which caused these values to be confused, use `mval`
for region relative mouse coordinates, otherwise `event_xy`.
- Pass region relative coordinates to sample_detail_dyntopo &
sample_detail_voxel as there is no reason to use screen-space values.
- Rename invalid use of mval for screen-space coordinates.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_transform.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_transform.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.c b/source/blender/editors/sculpt_paint/sculpt_transform.c index cb0a3b75094..48033f3407e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.c +++ b/source/blender/editors/sculpt_paint/sculpt_transform.c @@ -422,10 +422,11 @@ static int sculpt_set_pivot_position_exec(bContext *C, wmOperator *op) /* Pivot to ray-cast surface. */ else if (mode == SCULPT_PIVOT_POSITION_CURSOR_SURFACE) { float stroke_location[3]; - float mouse[2]; - mouse[0] = RNA_float_get(op->ptr, "mouse_x"); - mouse[1] = RNA_float_get(op->ptr, "mouse_y"); - if (SCULPT_stroke_get_location(C, stroke_location, mouse)) { + const float mval[2] = { + RNA_float_get(op->ptr, "mouse_x"), + RNA_float_get(op->ptr, "mouse_y"), + }; + if (SCULPT_stroke_get_location(C, stroke_location, mval)) { copy_v3_v3(ss->pivot_pos, stroke_location); } } |