Fixes grid overlapping content; fixes text-selection annoyance with grid.
authordsc <david.schoonover@gmail.com>
Sun, 21 Nov 2010 23:36:07 +0000 (15:36 -0800)
committerdsc <david.schoonover@gmail.com>
Sun, 21 Nov 2010 23:36:07 +0000 (15:36 -0800)
css/lttl.css
src/tanks/config.js
src/tanks/thing/player.js
src/tanks/ui/grid.js

index 08cc5b0..9717a2b 100644 (file)
@@ -10,7 +10,8 @@ td { text-align:center; vertical-align:middle; }
 
 table.grid { position:absolute; top:0; left:0; z-index:10; }
 table.grid,
-table.grid td { outline:1px solid rgba(255,255,255,0.1); color:transparent; font: 18pt monospace; 
+table.grid td { /* outline:1px solid rgba(255,255,255,0.1); */ 
+    color:transparent; font: 18pt monospace; 
     margin:0; padding:0; white-space:nowrap; overflow:hidden; }
 .gridShowCoords table.grid td:hover { color:rgba(255,255,255,0.1); }
 
index 948c6d0..d6e2652 100644 (file)
@@ -6,7 +6,7 @@ tanks.config = {
         traceTrajectories : false
     },
     debug : {
-        gridShowCoords : true
+        gridShowCoords : false
         
     }
 };
\ No newline at end of file
index b4a2af0..efad127 100644 (file)
@@ -133,6 +133,12 @@ PlayerTank = Tank.subclass('PlayerTank', {
             case 3: evt.middleMouse = true; break;
         }
         this.updateMeta(evt);
+        
+        if (window.getSelection) {
+            window.getSelection().removeAllRanges();
+        }
+        
+        return false;
     },
     
     mouseup : function mouseup(evt){
@@ -144,6 +150,12 @@ PlayerTank = Tank.subclass('PlayerTank', {
             case 3: evt.middleMouse = false; break;
         }
         this.updateMeta(evt);
+        
+        if (window.getSelection) {
+            window.getSelection().removeAllRanges();
+        }
+        
+        return false;
     },
     
     mousemove : function mousemove(evt){
index 4eefd43..ca98808 100644 (file)
@@ -4,6 +4,7 @@ Grid = new Y.Class('Grid', Rect, {
     lineWidth : 0.5,
     strokeStyle : '#6E6E6E',
     
+    
     init : function init(cols,rows, size){
         this.cols = cols;
         this.rows = rows;
@@ -13,7 +14,10 @@ Grid = new Y.Class('Grid', Rect, {
     
     drawShape : function drawShape(ctx){
         var tbody = $('<tbody/>')
-        ,   cols = this.cols, rows = this.rows, size = this.size
+        ,   cols = this.cols, rows = this.rows
+        ,   size = this.size
+        ,   w    =  this.canvasWidth
+        ,   h    =  this.canvasHeight
         ;
         
         Y(0, rows).forEach(function(y){
@@ -33,18 +37,7 @@ Grid = new Y.Class('Grid', Rect, {
                 .append(tbody)
                 .prependTo( this.layer );
         
-        this.canvas.remove();
-        
-        return this;
-    },
-    
-    _drawShape : function drawShape(ctx){
-        var size =  this.size
-        ,   rows =  this.rows
-        ,   cols =  this.cols
-        ,   w    =  this.canvasWidth
-        ,   h    =  this.canvasHeight
-        ;
+        // this.canvas.remove();
         
         ctx.lineWidth   = this.lineWidth;
         ctx.strokeStyle = this.strokeStyle;