     return [xrange, yrange]
 
   _selecting : (e, x_, y_) ->
-    [x, y] = @mouse_coords(e, x_, y_)
+    [x, y] = @mouse_coords(e, e.layerX, e.layerY)
     @mset({'current_x' : x, 'current_y' : y})
     return null
 

      safebind(this, renderer.get_ref('xmapper'), 'change', select_callback)
      safebind(this, renderer.get_ref('ymapper'), 'change', select_callback)

  bind_events : (plotview) ->
    @plotview = plotview
    eventSink = plotview.eventSink
    evgen = new TwoPointEventGenerator(
      eventBasename:"SelectionTool", keyName:"ctrlKey", buttonText:"Selection Tool")
    evgen.bind_events(plotview, eventSink)
    eventSink.on('SelectionTool:UpdatingMouseMove', (e) =>
      @_selecting(e, e.layerX, e.layerY))

    eventSink.on('SelectionTool:SetBasepoint', (e) =>
      @_start_selecting(e, e.layerX, e.layerY))

    eventSink.on('SelectionTool:deactivated', (e) =>
      @_stop_selecting())

  mouse_coords : (e, x, y) ->
    [x, y] = [@plot_model.rxpos(x), @plot_model.rypos(y)]

      'end' : end
    }, {'local' : true})

  _drag : (e) ->
    [x, y] = @mouse_coords(e, e.layerX, e.layerY)
    xdiff = x - @x
    ydiff = y - @y
    [@x, @y] = [x, y]
    xmappers = (@model.resolve_ref(x) for x in @mget('xmappers'))
    ymappers = (@model.resolve_ref(x) for x in @mget('ymappers'))
    for xmap in xmappers
