Explorar o código

Merge pull request #2925 from QuentinRillet/master

Fix size render on resize
David Catuhe %!s(int64=7) %!d(string=hai) anos
pai
achega
982756c97b
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      sandbox/index.js

+ 15 - 0
sandbox/index.js

@@ -204,4 +204,19 @@ if (BABYLON.Engine.isSupported()) {
             }, 5000);
         }, 5000);
     }
+
+    sizeScene();
+
+    window.onresize = function () {
+        sizeScene();
+    }
+}
+
+function sizeScene () {
+    let divInspWrapper = document.getElementsByClassName('insp-wrapper')[0];
+    if (divInspWrapper) {
+        let divFooter = document.getElementsByClassName('footer')[0];
+        divInspWrapper.style.height = (document.body.clientHeight - divFooter.clientHeight) + "px";
+        divInspWrapper.style['max-width'] = document.body.clientWidth + "px";
+    }
 }