don't run stylus-on-overlay code unless the overlay is a web3d overlay

This commit is contained in:
Seth Alves 2017-03-06 12:38:19 -08:00
parent 27066e89a6
commit 4886f1cbfc
2 changed files with 7 additions and 1 deletions

View file

@ -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);
}

View file

@ -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;
}