     return
     
   onInitialized: (n,m) ->
-    if n is @tessellation.group.n and m is tessellation.group.m
+    if (n is @tessellation.group.n) and (m is @tessellation.group.m)
       console.log "Worker initialized"
       @workerReady = true
       #now waiting for first rendered field.

redraw = -> dirty = true

drawEverything = ->
  s = Math.min( canvas.width, canvas.height ) / 2 #
  context.fillStyle="white"
  #context.clearRect 0, 0, canvas.width, canvas.height
  context.fillRect 0, 0, canvas.width, canvas.height
  context.save()
  context.scale s, s
  context.translate 1, 1
  context.fillStyle = "black"

  draw: (cells, context) ->
    return false if (not @cellShapes) or (not @workerReady)
    #first borders
    if @drawEmpty
      context.beginPath()
      for cell, i in @cells
        unless cells.get cell
          runCommands context, @cellShapes[i]
          null
      context.stroke()

    #then cells
    context.beginPath()
