     return off
 
   canvasMove: (event) =>
-    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
     switch @state.type
       when 'down'
         # If the user moves more than @settings.draggingOffset pixels

        changed = yes
      @map.setNeedsRedraw yes if changed

    x = event.pageX - $('#main-canvas').position().left
    y = event.pageY - $('#main-canvas').position().top
    info = @renderer.resolveScreenCoordinates(x, y)

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

      when 'dragging'
        @draggingMove event
      when 'normal'
        if (side = @renderer.sideAtScreenCoordinates(mouseX, mouseY)) and side isnt 'floor'
          $('body').css 'cursor', @settings.dragCursor
        else
          $('body').css 'cursor', @settings.defaultCursor
