Minor Code Adjustments

Minor Code Adjustments
This commit is contained in:
Alezia Kurdis 2020-12-29 22:19:11 -05:00 committed by GitHub
parent ec55884dae
commit 0db2d6f041
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 19 deletions

View file

@ -1110,16 +1110,16 @@ function findClickedEntity(event) {
var result; var result;
if (expectingRotateAsClickedSurface) { if (expectingRotateAsClickedSurface) {
if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) { if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) {
audioFeedback.rejection(); audioFeedback.rejection();
Window.notifyEditError("You have nothing selected, or the selection is locked."); Window.notifyEditError("You have nothing selected, or the selection is locked.");
expectingRotateAsClickedSurface = false; expectingRotateAsClickedSurface = false;
} else { } else {
//Rotate Selection according the Surface Normal //Rotate Selection according the Surface Normal
selectionDisplay.rotateSelection(Quat.lookAt(Vec3.ZERO, Vec3.multiply(entityResult.surfaceNormal, -1), Vec3.UP)); selectionDisplay.rotateSelection(Quat.lookAt(Vec3.ZERO, Vec3.multiply(entityResult.surfaceNormal, -1), Vec3.UP));
selectionManager._update(false, this); selectionManager._update(false, this);
pushCommandForSelections(); pushCommandForSelections();
expectingRotateAsClickedSurface = false; expectingRotateAsClickedSurface = false;
audioFeedback.action(); audioFeedback.action();
} }
keepSelectedOnNextClick = true; keepSelectedOnNextClick = true;
return null; return null;

View file

@ -105,16 +105,16 @@ SelectionManager = (function() {
} }
if (expectingRotateAsClickedSurface) { if (expectingRotateAsClickedSurface) {
if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) { if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) {
audioFeedback.rejection(); audioFeedback.rejection();
Window.notifyEditError("You have nothing selected, or the selection is locked."); Window.notifyEditError("You have nothing selected, or the selection is locked.");
expectingRotateAsClickedSurface = false; expectingRotateAsClickedSurface = false;
} else { } else {
//Rotate Selection according the Surface Normal //Rotate Selection according the Surface Normal
selectionDisplay.rotateSelection(Quat.lookAt(Vec3.ZERO, Vec3.multiply(messageParsed.surfaceNormal, -1), Vec3.UP)); selectionDisplay.rotateSelection(Quat.lookAt(Vec3.ZERO, Vec3.multiply(messageParsed.surfaceNormal, -1), Vec3.UP));
that._update(false, this); that._update(false, this);
pushCommandForSelections(); pushCommandForSelections();
expectingRotateAsClickedSurface = false; expectingRotateAsClickedSurface = false;
audioFeedback.action(); audioFeedback.action();
} }
} else { } else {
if (hmdMultiSelectMode) { if (hmdMultiSelectMode) {
@ -2411,7 +2411,7 @@ SelectionDisplay = (function() {
SelectionManager.saveProperties(); SelectionManager.saveProperties();
if (selectionManager.selections.length === 1 && spaceMode === SPACE_LOCAL) { if (selectionManager.selections.length === 1 && spaceMode === SPACE_LOCAL) {
currentRotation = SelectionManager.localRotation; currentRotation = SelectionManager.localRotation;
}else{ } else {
currentRotation = SelectionManager.worldRotation; currentRotation = SelectionManager.worldRotation;
} }
switch(axis) { switch(axis) {