Fix #873 New Selection untoggled selects selected cubes

This commit is contained in:
JannisX11 2021-04-11 23:14:12 +02:00
parent 6076d8856f
commit 9cc76e62c2

View File

@ -838,7 +838,7 @@ BARS.defineActions(function() {
], ],
onConfirm(formData) { onConfirm(formData) {
if (formData.new) { if (formData.new) {
selected.length = 0 selected.empty();
} }
let selected_group = Group.selected; let selected_group = Group.selected;
if (Group.selected) { if (Group.selected) {
@ -869,7 +869,7 @@ BARS.defineActions(function() {
if (obj instanceof Cube == false || obj.color.toString() != formData.color) return; if (obj instanceof Cube == false || obj.color.toString() != formData.color) return;
} }
if (Math.random() > rdm) return; if (Math.random() > rdm) return;
selected.push(obj) selected.safePush(obj)
}) })
updateSelection() updateSelection()
if (selected.length) { if (selected.length) {