diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-15 13:03:04 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-16 06:48:25 +0300 |
commit | 5e5285baf621a0c225cb5fc06fcec6ffed8302d7 (patch) | |
tree | fcdc655a6b063d32a7630b648e126c20ade295f2 /source/blender/editors/include/ED_curve.h | |
parent | 9a763d24f2b50ad38d22cad0a23d7344afe5f1c7 (diff) |
View 3D: move picking arguments into a struct & minor refactor
- Add SelectPick_Params struct to make picking logic more
straightforward and easier to extend.
- Use `eSelectOp` instead of booleans (extend, deselect, toggle)
which were used to represent 4 states (which wasn't obvious).
- Handle deselect_all when pocking instead of view3d_select_exec,
de-duplicate de-selection which was already needed in when replacing
the selection in picking functions.
- Handle outliner update & notifiers in the picking functions
instead of view3d_select_exec.
- Fix particle select deselect_all option which did nothing.
Diffstat (limited to 'source/blender/editors/include/ED_curve.h')
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index c97f97a2ddc..6097e7c69d9 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -19,6 +19,7 @@ struct EditNurb; struct Main; struct Nurb; struct Object; +struct SelectPick_Params; struct Text; struct UndoType; struct View3D; @@ -46,8 +47,12 @@ void ED_curve_editnurb_load(struct Main *bmain, struct Object *obedit); void ED_curve_editnurb_make(struct Object *obedit); void ED_curve_editnurb_free(struct Object *obedit); -bool ED_curve_editnurb_select_pick( - struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +/** + * \return True when pick finds an element or the selection changed. + */ +bool ED_curve_editnurb_select_pick(struct bContext *C, + const int mval[2], + const struct SelectPick_Params *params); struct Nurb *ED_curve_add_nurbs_primitive( struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob); @@ -100,10 +105,13 @@ int ED_curve_updateAnimPaths(struct Main *bmain, struct Curve *cu); bool ED_curve_active_center(struct Curve *cu, float center[3]); /** - * TextBox selection + * Text box selection. + * + * \return True when pick finds an element or the selection changed. */ -bool ED_curve_editfont_select_pick( - struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +bool ED_curve_editfont_select_pick(struct bContext *C, + const int mval[2], + const struct SelectPick_Params *params); /* editfont_undo.c */ |