   canvasDown: (event) =>
     switch @state.type
       when 'normal'
-        mouseX = event.pageX - $('#main-canvas').position().left
-        mouseY = event.pageY - $('#main-canvas').position().top
+        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'

      when 'dragging'
        @draggingUp event
      when 'down'
        x = event.offsetX || event.layerX - $(event.target).position().left
        y = event.offsetY || event.layerY - $(event.target).position().top
        if @state.info.block is @renderer.resolveScreenCoordinates(x, y).block
          @selectBlock @state.info.block
          @state.type = 'normal'
      when 'normal'

        changed = yes
      @map.setNeedsRedraw yes if changed

    mouseX = event.pageX - $('#main-canvas').offset().left
    mouseY = event.pageY - $('#main-canvas').offset().top
    info = @renderer.resolveScreenCoordinates mouseX, mouseY

    # If the user drags the stack onto another block, draw it there
    if info.side is 'top' or info.side is 'floor'
