     shapes: {}
     playerID: makeGuid()
     viewportSpace: (x,y) ->
-      {x: x-(@viewportOffset.x*@gridSize), y: y-(@viewportOffset.y*@gridSize)}
+      ret = {x: x-(@viewportOffset.x*@gridSize), y: y-(@viewportOffset.y*@gridSize)}
+      ret.visible = ret.x >= 0 && ret.x <= (@viewport.x*@gridSize)
+      ret
     maybeAdjustViewport: (shape) ->
       leftDiff = shape.x - @viewportOffset.x
       if leftDiff <= 2 and @viewportOffset.x > 0

        x = (@x*Tetris.gridSize) + (blockDef[0]*Tetris.gridSize) + 1 
        y = (@y*Tetris.gridSize) + (blockDef[1]*Tetris.gridSize) + 1
        alpha = if @owned then 1 else 0.4
        c.fillStyle = rgba(@color, alpha)
        vs = Tetris.viewportSpace(x,y)
        c.fillRect(vs.x, vs.y, Tetris.blockSize, Tetris.blockSize)
      definition = @shapeDefinition(this.rotation)
      drawBlock(definition[0])

      @y = opts.y    
    
    draw: (c) ->
      vs = Tetris.viewportSpace(@x*Tetris.gridSize+1, @y*Tetris.gridSize+1)
      return unless vs.visible
      c.fillStyle = "#c00"
      c.fillRect(vs.x, vs.y, Tetris.blockSize, Tetris.blockSize)
          
      
