Merge pull request #7925 from sethalves/overlay-or-grab-not-both

fix mouse-grab moving both an overlay and an entity at the same time
This commit is contained in:
Brad Hefta-Gaub 2016-05-19 17:38:32 -07:00
commit 8ff7af28be

View file

@ -320,6 +320,11 @@ Grabber.prototype.pressEvent = function(event) {
return;
}
if (Overlays.getOverlayAtPoint(Reticle.position) > 0) {
// the mouse is pointing at an overlay; don't look for entities underneath the overlay.
return;
}
var pickRay = Camera.computePickRay(event.x, event.y);
var pickResults = Entities.findRayIntersection(pickRay, true); // accurate picking
if (!pickResults.intersects) {