       @draglock = undefined
 
     _onMouseDown: (e) ->
-      [mouseX,mouseY]= getMouseCoords e
+      [mouseX,mouseY]= @getMouseCoords e
 
       unless @checkForEvents mouseX,mouseY
         @pauseEvent e

      #  @rect = @canvas.getBoundingClientRect()
      @draglock = undefined

      [mouseX,mouseY]= getMouseCoords e

      @moveCenter mouseX,mouseY
      @zoomCanvas @dblClickVx,@dblClickVy

    checkForEvents: (mouseX, mouseY) ->
      for name,arr of @events

        if (arr[0] <= mouseX and mouseX <= arr[2]) and
        (arr[1] <= mouseY and mouseY <= arr[3])
          arr[4]()
      false

    checkPos: ->
      [@viewportX,@viewportY] = @_checkPos @viewportX,@viewportY
