Merge pull request #9597 from druiz17/tabletStylus

better scrolling and fixed button touching
This commit is contained in:
Seth Alves 2017-02-02 16:56:13 -08:00 committed by GitHub
commit f40285c688

View file

@ -2911,7 +2911,7 @@ function MyController(hand) {
var pos3D = intersectInfo.point;
if (this.state == STATE_OVERLAY_STYLUS_TOUCHING &&
!this.deadspotExpired &&
!this.tabletStabbed &&
intersectInfo.distance < WEB_STYLUS_LENGTH / 2.0 + WEB_TOUCH_TOO_CLOSE) {
// they've stabbed the tablet, don't send events until they pull back
this.tabletStabbed = true;
@ -2919,8 +2919,15 @@ function MyController(hand) {
this.tabletStabbedPos3D = pos3D;
return;
}
if (this.tabletStabbed) {
return;
var origin = {x: this.tabletStabbedPos2D.x, y: this.tabletStabbedPos2D.y, z: 0};
var point = {x: pos2D.x, y: pos2D.y, z: 0};
var offset = Vec3.distance(origin, point);
var radius = 0.05;
if (offset < radius) {
return;
}
}
if (Overlays.keyboardFocusOverlay != this.grabbedOverlay) {