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:
authorCampbell Barton <campbell@blender.org>2022-04-04 06:11:44 +0300
committerCampbell Barton <campbell@blender.org>2022-04-04 06:11:44 +0300
commitdc5b1d6c75717a41c00042b667bc4a1a1609e588 (patch)
tree20a1265948358ee2caa6bfba46e7de47672c3795 /source/blender/editors/curve/editcurve.c
parentff82bb5e3a27a7e16482ff8970a844fc63844d8e (diff)
Cleanup: pass selection threshold to curve picking
Remove the extended version of ED_curve_editnurb_select_pick, pass the size threshold directly to this function but as the distance in pixels instead of a multiplier for ED_view3d_select_dist_px. Using a multiplier is a less direct way to reference the threshold.
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r--source/blender/editors/curve/editcurve.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 58ee5ccae64..755e538f415 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4725,16 +4725,9 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
bool ED_curve_editnurb_select_pick(bContext *C,
const int mval[2],
+ const int dist_px,
const struct SelectPick_Params *params)
{
- return ED_curve_editnurb_select_pick_ex(C, mval, 1.0f, params);
-}
-
-bool ED_curve_editnurb_select_pick_ex(bContext *C,
- const int mval[2],
- const float sel_dist_mul,
- const struct SelectPick_Params *params)
-{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewContext vc;
Nurb *nu;
@@ -4748,8 +4741,7 @@ bool ED_curve_editnurb_select_pick_ex(bContext *C,
ED_view3d_viewcontext_init(C, &vc, depsgraph);
copy_v2_v2_int(vc.mval, mval);
- bool found = ED_curve_pick_vert_ex(
- &vc, 1, sel_dist_mul * ED_view3d_select_dist_px(), &nu, &bezt, &bp, &hand, &basact);
+ bool found = ED_curve_pick_vert_ex(&vc, 1, dist_px, &nu, &bezt, &bp, &hand, &basact);
if (params->sel_op == SEL_OP_SET) {
if ((found && params->select_passthrough) &&