From 4886f1cbfcbebeeff7aefe42344707b6d62d29c8 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 6 Mar 2017 12:38:19 -0800 Subject: [PATCH] don't run stylus-on-overlay code unless the overlay is a web3d overlay --- interface/src/ui/overlays/Overlay.cpp | 3 +++ scripts/system/controllers/handControllerGrab.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/Overlay.cpp b/interface/src/ui/overlays/Overlay.cpp index 0ad2c94241..764422019e 100644 --- a/interface/src/ui/overlays/Overlay.cpp +++ b/interface/src/ui/overlays/Overlay.cpp @@ -100,6 +100,9 @@ void Overlay::setProperties(const QVariantMap& properties) { } QVariant Overlay::getProperty(const QString& property) { + if (property == "type") { + return QVariant(getType()); + } if (property == "color") { return xColorToVariant(_color); } diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 86461c0c0a..4dfa0b8f79 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -2031,6 +2031,9 @@ function MyController(hand) { var pointerEvent; if (rayPickInfo.overlayID) { var overlay = rayPickInfo.overlayID; + if (Overlays.getProperty(overlay, "type") != "web3d") { + return false; + } if (Overlays.keyboardFocusOverlay != overlay) { Entities.keyboardFocusEntity = null; Overlays.keyboardFocusOverlay = overlay; @@ -3388,7 +3391,7 @@ function MyController(hand) { if (this.state == STATE_OVERLAY_STYLUS_TOUCHING && intersectInfo.distance > max) { this.grabbedThingID = null; - this.setState(STATE_OFF, "pulled away from overlay"); + this.setState(STATE_OFF, "pulled away from overlay -- " + intersectInfo.distance + " max = " + max); return; }