Fix unexpectedly deleting multiple entities

This commit is contained in:
David Rowe 2017-07-28 09:35:29 +12:00
parent 21c15120ba
commit 9fe3a823ee

View file

@ -255,6 +255,7 @@
highlightedEntityID = null, // Root entity of highlighted entity set. highlightedEntityID = null, // Root entity of highlighted entity set.
wasAppScaleWithHandles = false, wasAppScaleWithHandles = false,
isOtherEditorEditingEntityID = false, isOtherEditorEditingEntityID = false,
wasGripPressed = false,
hoveredOverlayID = null, hoveredOverlayID = null,
// Position values. // Position values.
@ -590,6 +591,7 @@
} }
startEditing(); startEditing();
wasAppScaleWithHandles = isAppScaleWithHandles; wasAppScaleWithHandles = isAppScaleWithHandles;
wasGripPressed = hand.gripPressed();
} }
function updateEditorGrabbing() { function updateEditorGrabbing() {
@ -796,6 +798,7 @@
updateState(); updateState();
wasAppScaleWithHandles = isAppScaleWithHandles; wasAppScaleWithHandles = isAppScaleWithHandles;
} }
wasGripPressed = false;
break; break;
} }
if (!hand.valid()) { if (!hand.valid()) {
@ -808,8 +811,10 @@
setState(EDITOR_SEARCHING); setState(EDITOR_SEARCHING);
} }
} else if (hand.gripPressed()) { } else if (hand.gripPressed()) {
selection.deleteEntities(); if (!wasGripPressed) {
setState(EDITOR_SEARCHING); selection.deleteEntities();
setState(EDITOR_SEARCHING);
}
} else { } else {
debug(side, "ERROR: Unexpected condition in EDITOR_GRABBING!"); debug(side, "ERROR: Unexpected condition in EDITOR_GRABBING!");
} }