improve model/group selection with shiftKey. prevent drag/move unless shiftKey
This commit is contained in:
parent
fd645737e2
commit
356a2634e8
3 changed files with 32 additions and 9 deletions
|
|
@ -62,21 +62,39 @@ let selection = {
|
|||
|
||||
// @param group {MeshObject}
|
||||
add(object) {
|
||||
// pendantic code necessary to minimize re-entrant api calls
|
||||
if (object.models) {
|
||||
// if group, remove discrete selected members
|
||||
for (let m of object.models) {
|
||||
if (selected.contains(m)) {
|
||||
selection.remove(m);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if model, remove selcted group
|
||||
if (selected.contains(object.group)) {
|
||||
selection.remove(object.group);
|
||||
}
|
||||
}
|
||||
selected.addOnce(object);
|
||||
selection.update();
|
||||
},
|
||||
|
||||
toggle(object) {
|
||||
selected.remove(object) || selected.addOnce(object);
|
||||
selection.update();
|
||||
},
|
||||
|
||||
// @param group {MeshObject}
|
||||
remove(object) {
|
||||
selected.remove(object);
|
||||
selection.update();
|
||||
},
|
||||
|
||||
// @param group {MeshObject}
|
||||
toggle(object) {
|
||||
if (selected.contains(object)) {
|
||||
selection.remove(object);
|
||||
} else {
|
||||
selection.add(object);
|
||||
}
|
||||
},
|
||||
|
||||
clear() {
|
||||
selected = [];
|
||||
selection.update();
|
||||
|
|
|
|||
Loading…
Reference in a new issue