From 2c3c96b6005cee939076c47da795d0a077d4e657 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 19 Jan 2017 14:21:17 -0800 Subject: [PATCH] Fix for broken entity scrolling introduced by 23ea65e2 this.grabbedEntity was being cleared before entityTouchingExit transition could send the release event. --- scripts/system/controllers/handControllerGrab.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index a021c8657b..223902e5c5 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2719,6 +2719,8 @@ function MyController(hand) { Entities.sendClickReleaseOnEntity(this.grabbedEntity, pointerEvent); Entities.sendHoverLeaveEntity(this.grabbedEntity, pointerEvent); } + this.grabbedEntity = null; + this.grabbedOverlay = null; }; this.entityTouching = function(dt) { @@ -2728,7 +2730,6 @@ function MyController(hand) { entityPropertiesCache.addEntity(this.grabbedEntity); if (this.state == STATE_ENTITY_LASER_TOUCHING && !this.triggerSmoothedGrab()) { - this.grabbedEntity = null; this.setState(STATE_OFF, "released trigger"); return; } @@ -2740,7 +2741,6 @@ function MyController(hand) { if (this.state == STATE_ENTITY_STYLUS_TOUCHING && intersectInfo.distance > WEB_STYLUS_LENGTH / 2.0 + WEB_TOUCH_Y_OFFSET) { - this.grabbedEntity = null; this.setState(STATE_OFF, "pulled away from web entity"); return; } @@ -2837,19 +2837,19 @@ function MyController(hand) { Overlays.sendMouseReleaseOnOverlay(this.grabbedOverlay, pointerEvent); Overlays.sendHoverLeaveOverlay(this.grabbedOverlay, pointerEvent); } + this.grabbedEntity = null; + this.grabbedOverlay = null; }; this.overlayTouching = function (dt) { this.touchingEnterTimer += dt; if (this.state == STATE_OVERLAY_STYLUS_TOUCHING && this.triggerSmoothedSqueezed()) { - this.grabbedEntity = null; this.setState(STATE_OFF, "trigger squeezed"); return; } if (this.state == STATE_OVERLAY_LASER_TOUCHING && !this.triggerSmoothedGrab()) { - this.grabbedEntity = null; this.setState(STATE_OFF, "released trigger"); return; }