     return off
 
   canvasMove: (event) =>
-    mouseX = event.pageX - $('#main-canvas').offset().left
-    mouseY = event.pageY - $('#main-canvas').offset().top
+    mouseX = event.pageX - @mainCanvas.offset().left
+    mouseY = event.pageY - @mainCanvas.offset().top
     switch @state.type
       when 'down'
         # If the user moves more than @settings.draggingOffset pixels

  canvasDown: (event) =>
    switch @state.type
      when 'normal'
        mouseX = event.pageX - $('#main-canvas').offset().left
        mouseY = event.pageY - $('#main-canvas').offset().top
        info = @renderer.resolveScreenCoordinates mouseX, mouseY
        if info.block
          @state.type  = 'down'

        changed = yes
      @map.setNeedsRedraw yes if changed

    mouseX = event.pageX - @mainCanvas.offset().left
    mouseY = event.pageY - @mainCanvas.offset().top
    info = @renderer.resolveScreenCoordinates mouseX, mouseY

    # If the user drags the stack onto another block, draw it there
