Commit 0acb52fda94ad954fb5ca1a80b67ae2a4c605879

Authored by Gustav Johansen
1 parent 0e9ccfb3

Gjort tekst på segmenter litt mindre slik ingenting forsvinner ved lengre segmenter

Showing 4 changed files with 44 additions and 45 deletions   Show diff stats
@@ -42,46 +42,47 @@ @@ -42,46 +42,47 @@
42 <script src="js/Constants.js"></script> 42 <script src="js/Constants.js"></script>
43 43
44 </head> 44 </head>
45 -<body onload="main()">  
46 - <canvas id="renderCanvas"></canvas>  
47 - <a id="inputTabFix" href="" onClick="return false;"></a> 45 + <body onload="main()">
  46 + <canvas id="renderCanvas"></canvas>
  47 + <a id="inputTabFix" href="" onClick="return false;"></a>
48 48
49 - <!--<div id="moduleMenu">  
50 - <table id="moduleMenuRow1">  
51 - <tr>  
52 - <th class="moduleMenuHeader" colspan="6">Stolper</th>  
53 - </tr>  
54 - <tr>  
55 - <td colspan="1"></td>  
56 - <td colspan="1"></td>  
57 - <td colspan="1"></td>  
58 - <td colspan="1"></td>  
59 - <td colspan="1"></td>  
60 - <td colspan="1"></td>  
61 - </tr>  
62 - <tr>  
63 - <td class="poleButtonHeader" colspan="2">180* Stolpe</td>  
64 - <td class="poleButtonHeader" colspan="2">Endestolpe</td>  
65 - <td class="poleButtonHeader" colspan="2">Veggfeste</td>  
66 - </tr>  
67 - <tr>  
68 - <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_180.png" onmousedown="addPoleFromMenu('180')" ondragstart="return false"/></td>  
69 - <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_end.png" onmousedown="addPoleFromMenu('end')" ondragstart="return false"/></td>  
70 - <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_end.png" onmousedown="addPoleFromMenu('wall')" ondragstart="return false"/></td>  
71 - </tr>  
72 - <tr>  
73 - <td colspan="1"></td>  
74 - <td class="poleButtonHeader" colspan="2">90* Stolpe</td>  
75 - <td class="poleButtonHeader" colspan="2">45* Stolpe</td>  
76 - <td colspan="1"></td>  
77 - </tr>  
78 - <tr>  
79 - <td colspan="1"></td>  
80 - <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_90.png" onmousedown="addPoleFromMenu('90')" ondragstart="return false"/></td>  
81 - <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_135.png" onmousedown="addPoleFromMenu('45')" ondragstart="return false"/></td>  
82 - <td colspan="1"></td>  
83 - </tr>  
84 - </table>  
85 - <p class ="moduleMenuHeader" id="fpsCounter">fps: </p>-->  
86 -</body> 49 + <!--<div id="moduleMenu">
  50 + <table id="moduleMenuRow1">
  51 + <tr>
  52 + <th class="moduleMenuHeader" colspan="6">Stolper</th>
  53 + </tr>
  54 + <tr>
  55 + <td colspan="1"></td>
  56 + <td colspan="1"></td>
  57 + <td colspan="1"></td>
  58 + <td colspan="1"></td>
  59 + <td colspan="1"></td>
  60 + <td colspan="1"></td>
  61 + </tr>
  62 + <tr>
  63 + <td class="poleButtonHeader" colspan="2">180* Stolpe</td>
  64 + <td class="poleButtonHeader" colspan="2">Endestolpe</td>
  65 + <td class="poleButtonHeader" colspan="2">Veggfeste</td>
  66 + </tr>
  67 + <tr>
  68 + <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_180.png" onmousedown="addPoleFromMenu('180')" ondragstart="return false"/></td>
  69 + <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_end.png" onmousedown="addPoleFromMenu('end')" ondragstart="return false"/></td>
  70 + <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_end.png" onmousedown="addPoleFromMenu('wall')" ondragstart="return false"/></td>
  71 + </tr>
  72 + <tr>
  73 + <td colspan="1"></td>
  74 + <td class="poleButtonHeader" colspan="2">90* Stolpe</td>
  75 + <td class="poleButtonHeader" colspan="2">45* Stolpe</td>
  76 + <td colspan="1"></td>
  77 + </tr>
  78 + <tr>
  79 + <td colspan="1"></td>
  80 + <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_90.png" onmousedown="addPoleFromMenu('90')" ondragstart="return false"/></td>
  81 + <td class="poleButtonContainer" colspan="2"><input class="poleButton" type="image" src="images/menu_pole_135.png" onmousedown="addPoleFromMenu('45')" ondragstart="return false"/></td>
  82 + <td colspan="1"></td>
  83 + </tr>
  84 + </table>
  85 + <p class ="moduleMenuHeader" id="fpsCounter">fps: </p>-->
  86 +
  87 + </body>
87 </html> 88 </html>
88 \ No newline at end of file 89 \ No newline at end of file
@@ -346,7 +346,6 @@ class Glass { @@ -346,7 +346,6 @@ class Glass {
346 } 346 }
347 this.mesh.markAsDirty(); 347 this.mesh.markAsDirty();
348 this.onTerrace = true; 348 this.onTerrace = true;
349 - console.log("hei");  
350 349
351 setTimeout(() => { 350 setTimeout(() => {
352 this.checkForSegment(holder); 351 this.checkForSegment(holder);
@@ -100,7 +100,7 @@ class Segment { @@ -100,7 +100,7 @@ class Segment {
100 100
101 if(this.lengthTextPlane) { 101 if(this.lengthTextPlane) {
102 this.lengthTextPlane.material.diffuseTexture.getContext().clearRect(0, 0, 128, 32); 102 this.lengthTextPlane.material.diffuseTexture.getContext().clearRect(0, 0, 128, 32);
103 - this.lengthTextPlane.material.diffuseTexture.drawText(length.toFixed(2) + "mm", 0, 26, "20px Verdana", "red", "white"); 103 + this.lengthTextPlane.material.diffuseTexture.drawText(length.toFixed(2) + "mm", 0, 26, "19px Verdana", "red", "white");
104 this.lengthTextPlane.position = new BABYLON.Vector3(planeX, 5, planeZ); 104 this.lengthTextPlane.position = new BABYLON.Vector3(planeX, 5, planeZ);
105 105
106 if(ends.dir === "x") { 106 if(ends.dir === "x") {
@@ -156,7 +156,7 @@ class Segment { @@ -156,7 +156,7 @@ class Segment {
156 else { 156 else {
157 var dt = new BABYLON.DynamicTexture("segmentText", {width: 128, height: 32}, scene); 157 var dt = new BABYLON.DynamicTexture("segmentText", {width: 128, height: 32}, scene);
158 dt.hasAlpha = true; 158 dt.hasAlpha = true;
159 - dt.drawText(length.toFixed(2) + "mm", 0, 26, "20px Verdana", "red", "white"); 159 + dt.drawText(length.toFixed(2) + "mm", 0, 26, "19px Verdana", "red", "white");
160 160
161 this.lengthTextPlane = BABYLON.MeshBuilder.CreatePlane("segmentTextPlane", {width: 512, height: 128}, scene); 161 this.lengthTextPlane = BABYLON.MeshBuilder.CreatePlane("segmentTextPlane", {width: 512, height: 128}, scene);
162 this.lengthTextPlane.material = new BABYLON.StandardMaterial("segmentPlaneMat2", scene); 162 this.lengthTextPlane.material = new BABYLON.StandardMaterial("segmentPlaneMat2", scene);
@@ -171,7 +171,6 @@ function onMouseMove(event) { @@ -171,7 +171,6 @@ function onMouseMove(event) {
171 } 171 }
172 else { 172 else {
173 pointerMeshClass.mesh.position = current; 173 pointerMeshClass.mesh.position = current;
174 - console.log(current);  
175 } 174 }
176 175
177 pointerMeshStartingPoint = current; 176 pointerMeshStartingPoint = current;