Fix mini tablet sometimes remaining parented when it shouldn't be

This commit is contained in:
David Rowe 2018-09-14 20:15:08 +12:00
parent ba56457663
commit 80aa74600f

View file

@ -804,6 +804,11 @@
} }
} }
function exitMiniGrabbed() {
// Explicitly unparent mini tablet in case controller grabbing code has reparented it.
ui.release();
}
function expandMini() { function expandMini() {
var scaleFactor = (Date.now() - miniExpandStart) / MINI_EXPAND_DURATION; var scaleFactor = (Date.now() - miniExpandStart) / MINI_EXPAND_DURATION;
if (scaleFactor < 1) { if (scaleFactor < 1) {
@ -896,7 +901,7 @@
MINI_GRABBED: { // Mini tablet is grabbed by other hand. MINI_GRABBED: { // Mini tablet is grabbed by other hand.
enter: null, enter: null,
update: updateMiniGrabbed, update: updateMiniGrabbed,
exit: null exit: exitMiniGrabbed
}, },
MINI_EXPANDING: { // Mini tablet is expanding before showing tablet proper. MINI_EXPANDING: { // Mini tablet is expanding before showing tablet proper.
enter: enterMiniExpanding, enter: enterMiniExpanding,