From 066c517dd741c3b58ea5801656800e282fee4705 Mon Sep 17 00:00:00 2001 From: Menithal Date: Fri, 18 Mar 2016 08:59:07 +0200 Subject: [PATCH] Grab.js: Update Position on Mouse Grab Start Fixes grab event issue where if the object is moving, the position does not update until the user has moved their mouse. This commit makes sure that the moment the user starts dragging on a object that isnt grabbed by another, the position is immediately updated instead of waiting for the user to move their mouse. --- examples/grab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/grab.js b/examples/grab.js index 3b6c79977e..f9d1f41b97 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -373,6 +373,10 @@ Grabber.prototype.pressEvent = function(event) { beacon.updatePosition(this.startPosition); + if(!entityIsGrabbedByOther(this.entityID)){ + this.moveEvent(event); + } + // TODO: play sounds again when we aren't leaking AudioInjector threads //Audio.playSound(grabSound, { position: entityProperties.position, volume: VOLUME }); }