       #  @rect = @canvas.getBoundingClientRect()
       @draglock = undefined
 
-      [mouseX,mouseY]= getMouseCoords e
+      [mouseX,mouseY]= @getMouseCoords e
 
       @moveCenter mouseX,mouseY
       @zoomCanvas @dblClickVx,@dblClickVy


      # zoom control
      @ctx.fillStyle = "red"
      @ctx.fillRect @canvas.width - 40, @canvas.height - 35,15,15
      callback = -> alert "hi"
      @events.zoomIn = [@canvas.width - 40, @canvas.height - 35,15,15,callback]

      @ctx.fillStyle = "blue"
      @ctx.fillRect @canvas.width - 40, @canvas.height - 20,15,15

    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
