From 015d464da8fb71b786e0ff3051f6aadffadbbb37 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Sun, 4 Nov 2018 18:09:30 +0000
Subject: [PATCH] Scale canvas 200% wide so no eye buffers on desktop

---
 .stylelintrc                     | 1 +
 src/assets/stylesheets/hub.scss  | 9 ++++++++-
 src/components/hand-controls2.js | 2 --
 src/hub.js                       | 3 +++
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/.stylelintrc b/.stylelintrc
index 806eeab42..e0ae6ebc3 100644
--- a/.stylelintrc
+++ b/.stylelintrc
@@ -3,6 +3,7 @@
   "rules": {
     "indentation": 2,
 		"selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": ["local"] }],
+		"selector-type-no-unknown": [true, { "ignoreTypes": ["/^a-/"] }],
 		"no-descending-specificity": false
   }
 }
diff --git a/src/assets/stylesheets/hub.scss b/src/assets/stylesheets/hub.scss
index 8ce382b26..1f7f530e9 100644
--- a/src/assets/stylesheets/hub.scss
+++ b/src/assets/stylesheets/hub.scss
@@ -7,7 +7,14 @@
 @import 'entry';
 @import 'audio';
 @import 'info-dialog';
-@import 'shared';
+
+body.vr-mode {
+  a-scene.fullscreen {
+    .a-canvas {
+      width: 200% !important;
+    }
+  }
+}
 
 .a-enter-vr, .a-orientation-modal {
   display: none;
diff --git a/src/components/hand-controls2.js b/src/components/hand-controls2.js
index fa2cc938c..ff1d2e87b 100644
--- a/src/components/hand-controls2.js
+++ b/src/components/hand-controls2.js
@@ -12,8 +12,6 @@ const POSES = {
   mrpDown: "mrpDown"
 };
 
-// TODO: If the hands or controllers are mispositioned, then rightHand.controllerPose and rightHand.pose
-//       should be bound differently.
 export const LEFT_CONTROLLER_OFFSETS = {
   default: new THREE.Matrix4(),
   "oculus-touch-controls": new THREE.Matrix4().makeTranslation(-0.025, -0.03, 0.1),
diff --git a/src/hub.js b/src/hub.js
index 5483dfa13..cee2b1be8 100644
--- a/src/hub.js
+++ b/src/hub.js
@@ -317,6 +317,9 @@ document.addEventListener("DOMContentLoaded", async () => {
 
   window.APP.scene = scene;
 
+  scene.addEventListener("enter-vr", () => document.body.classList.add("vr-mode"));
+  scene.addEventListener("exit-vr", () => document.body.classList.remove("vr-mode"));
+
   registerNetworkSchemas();
 
   remountUI({
-- 
GitLab