Commit bb30a8e549e63485c16a5639aaadb0c74d07f3f2

Authored by Lars Jørgen Fredheim
1 parent 2c6ac5b6

fix

Showing 2 changed files with 9 additions and 6 deletions   Show diff stats
css/style.css
... ... @@ -6,7 +6,6 @@ html, body {
6 6 padding : 0;
7 7 font-family: Arial, Helvetica, sans-serif;
8 8 font-size: 16px;
9   - text-align: center;
10 9 }
11 10  
12 11 #renderCanvas {
... ... @@ -27,6 +26,7 @@ label {
27 26  
28 27 #main {
29 28 display: none;
  29 + text-align: center;
30 30 }
31 31  
32 32 #initTerrace {
... ...
js/app.js
... ... @@ -62,15 +62,12 @@ function main() {
62 62 glassProvider = new GlassProvider();
63 63 terrace = new Terrace();
64 64 meshControls = new MeshControls();
65   - gui = new GUI();
  65 + //gui = new GUI();
66 66 //gui.showLayoutSelection();
67 67  
68 68 initButtons();
69 69  
70   - window.addEventListener("resize", function () { // Watch for browser/canvas resize events
71   - engine.resize();
72   - camera.orthographicCamera.resize();
73   - });
  70 + window.addEventListener("resize", resize());
74 71  
75 72 window.addEventListener('keyup', function(event) {
76 73 if(event.keyCode === 81) {
... ... @@ -123,6 +120,11 @@ function main() {
123 120 });
124 121 }
125 122  
  123 +function resize() {
  124 + scene.getEngine().resize();
  125 + camera.orthographicCamera.resize();
  126 +}
  127 +
126 128 function onPointerDown(event) {
127 129 if(event.button === 0) {
128 130 if(meshControls.visible) {
... ... @@ -591,6 +593,7 @@ function drawTerrace() {
591 593 canvas.style.display = "inline";
592 594 terrace.displayTerrace(inputs);
593 595 camera.focusPerspectiveCamera();
  596 + resize();
594 597 } else {
595 598 document.getElementById("triggerModal").click();
596 599 }
... ...