diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2012-05-25 01:05:27 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2012-05-25 01:05:27 +0400 |
commit | 19e1d05461abafc32b5d952d5121f765f4208f94 (patch) | |
tree | 5c1f496aa0f00bb605b5c7bd8d69d02534d4c5c6 /source/blender/editors/object/object_lattice.c | |
parent | 9dc161e8edc421463d4bb0b6237770b4656ca2a7 (diff) |
Modifications to the view3d.select() operator:
1. Two new boolean options have been added to the operator: "deselect"
and "toggle".
2. The previous behavior of "extend" (toggling the selection) has
been moved to the "toggle" option.
3. "extend" now only extends the selection, it never deselects.
4. "deselect" is pretty self-explanatory: it deselects (i.e. opposite
of extend).
5. The built-in keymap has been changed to use "toggle" where
"extend" was used before for this operator, to maintain the
previous behavior in the default keymap.
In short, this works towards making "extend" and "deselect" fully
consistent across all selection tools (adding to and removing from
selection, respectively), but still preserves the old behavior
as well.
(Patch reviewed by Brecht.)
Diffstat (limited to 'source/blender/editors/object/object_lattice.c')
-rw-r--r-- | source/blender/editors/object/object_lattice.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 7b37ca8ab95..f6e8ccf4ec9 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -335,7 +335,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, const int mval[2], int sel) return data.bp; } -int mouse_lattice(bContext *C, const int mval[2], int extend) +int mouse_lattice(bContext *C, const int mval[2], int extend, int deselect, int toggle) { ViewContext vc; BPoint *bp = NULL; @@ -344,12 +344,20 @@ int mouse_lattice(bContext *C, const int mval[2], int extend) bp = findnearestLattvert(&vc, mval, 1); if (bp) { - if (extend == 0) { - ED_setflagsLatt(vc.obedit, 0); - bp->f1 |= SELECT; + if (extend) { + bp->f1 |= SELECT; + } + else if (deselect) { + bp->f1 &= ~SELECT; + } + else if (toggle) { + bp->f1 ^= SELECT; /* swap */ } else - bp->f1 ^= SELECT; /* swap */ + { + ED_setflagsLatt(vc.obedit, 0); + bp->f1 |= SELECT; + } WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data); |