Explorar el Código

Inspector - fix bug when displaying mesh vertices

Temechon hace 8 años
padre
commit
beb67cf0eb
Se han modificado 3 ficheros con 22 adiciones y 13 borrados
  1. 16 9
      inspector/index.html
  2. 5 3
      inspector/src/gui/Tooltip.ts
  3. 1 1
      inspector/src/treetools/Info.ts

+ 16 - 9
inspector/index.html

@@ -19,8 +19,8 @@
             font-family:sans-serif;
         }
 
-        /* First try : PG-like
-        #game-canvas {
+        /* First try : PG-like */
+        /*#game-canvas {
             width:75%;
             height:100%; 
             top:0;
@@ -39,12 +39,19 @@
             background-color: #333;
         }*/
         
+        /*Second : sandbox like*/
         #game-canvas {
             position:absolute;
             width:100%;
-            height:650px; 
+            height:100%; 
             top:0;
-            left : 150px;
+        }
+        .fakeFooter {
+            position:absolute;
+            width:100%;
+            height:50px;
+            background-color: #333;
+            bottom: 0;
         }
 
     </style>
@@ -52,15 +59,15 @@
 </head>
 <body>
     
-    <!-- First try : PG-like
+    <!-- First try : PG-like 
     <div class="fakeToolbar"></div>
     <div class="mini">
         <div class="fakeBarAgain"></div>
         <canvas id="game-canvas"></canvas> 
-    </div>
-    -->
-    <!--Second try : Sandbox-like-->
-    <canvas id="game-canvas"></canvas> 
+    </div>-->
+    <!--Second try : Sandbox-like -->
+    <canvas id="game-canvas"></canvas>
+    <div class="fakeFooter"></div>
 
     <!--Starting the game-->
     <script>

+ 5 - 3
inspector/src/gui/Tooltip.ts

@@ -11,11 +11,13 @@ module INSPECTOR {
         /** The tooltip div */
         private _infoDiv : HTMLDivElement;
         
-        constructor(elem: HTMLElement, tip:string) {
+        constructor(elem: HTMLElement, tip:string, attachTo?:HTMLElement) {
             
             this._elem = elem;
-            
-            this._infoDiv = Helpers.CreateDiv('tooltip', this._elem.parentElement) as HTMLDivElement;
+            if (!attachTo) {
+                attachTo = this._elem.parentElement;
+            }
+            this._infoDiv = Helpers.CreateDiv('tooltip', attachTo) as HTMLDivElement;
             
 
             this._elem.addEventListener('mouseover', () => { 

+ 1 - 1
inspector/src/treetools/Info.ts

@@ -20,7 +20,7 @@ module INSPECTOR{
             this._obj = obj;
             this._elem.classList.add('fa-info-circle');
 
-            this._tooltip = new Tooltip(this._elem, this._obj.getInfo());
+            this._tooltip = new Tooltip(this._elem, this._obj.getInfo(), this._elem);
         }
 
         // Nothing to do on click