Don't try to draw a grid if it's not going to work (no lands).

This commit is contained in:
Nick Winter 2014-03-22 14:28:18 -07:00
parent 76ec738213
commit eec46dcb48

View file

@ -418,6 +418,8 @@ module.exports = Surface = class Surface extends CocoClass
@gridShape.alpha = 0.125
@gridShape.graphics.beginStroke "blue"
gridSize = Math.round(@world.size()[0] / 20)
unless gridSize > 0.1
return console.error "Grid size is", gridSize, "so we can't draw a grid."
wopStart = x: 0, y: 0
wopEnd = x: @world.size()[0], y: @world.size()[1]
supStart = @camera.worldToSurface wopStart