Fix button not unpressing when cursor moves off it

This commit is contained in:
David Rowe 2017-07-29 14:51:58 +12:00
parent 52a2538d73
commit 30595c78a0

View file

@ -114,9 +114,8 @@ ToolMenu = function (side, leftInputs, rightInputs, setAppScaleWithHandlesCallba
}
// Button click.
if (isHighlightingButton && controlHand.triggerClicked() !== isButtonPressed) {
isButtonPressed = controlHand.triggerClicked();
if (!isHighlightingButton || controlHand.triggerClicked() !== isButtonPressed) {
isButtonPressed = isHighlightingButton && controlHand.triggerClicked();
if (isButtonPressed) {
Overlays.editOverlay(buttonOverlay, {
localPosition: Vec3.sum(BUTTON_PROPERTIES.localPosition, { x: 0, y: 0, z: 0.004 })