 
         bbox = new BBox({x0: x1, y0: y1, x1: x1+w, y1: y1+h})
 
-        if bbox.contains(hx, hy)
+        if bbox.contains(sx, sy)
           switch @model.click_policy
             when "hide"
               for r in item.renderers


  bind_bokeh_events: () ->
    @listenTo(@model, 'change:visible', @plot_view.request_render)

  compute_legend_bbox: () ->
    legend_names = @model.get_legend_names()

    {x, y, width, height} = @compute_legend_bbox()
    return new BBox({x0: x, y0: y, x1: x+width, y1: y+height})

  on_hit: (e) ->
    {sx, sy} = e.bokeh

    glyph_height = @model.glyph_height
    glyph_width = @model.glyph_width
    legend_spacing = @model.spacing
