       click: (e) =>
         pos = $(canvas).offset()
         _mouseP = arbor.Point(e.pageX-pos.left, e.pageY-pos.top)
-        object = particleSystem.nearest(_mouseP)
 
-        if @nodeHitTest(object.node, _mouseP)
+        hitEdge = false
+        particleSystem.eachEdge (edge, fromPoint, toPoint) =>
+          if (@edgeHitTest(edge, _mouseP, 10))
+            objectHandler.selectedEdge edge.data._neo_id
+            hitEdge = true
+            return false
+
+        if !hitEdge
+          object = particleSystem.nearest(_mouseP)
           objectHandler.selectedNode(object.node.name)
-        else
-          # click on an edge?
-          particleSystem.eachEdge (edge, fromPoint, toPoint) =>
-            if (@edgeHitTest(edge, _mouseP, 10))
-              objectHandler.selectedEdge edge.data._neo_id
-              return false
-
         false
 
     $(canvas)

      width = Math.min(width, maxWidth)
      height = Math.min(height, maxHeight)

      # Store dims so we can use them in hit testing later.
      # TODO sort out the MARGIN business (separate textSize from nodeSize)
      node.data.width = width + MARGIN*2;
      node.data.height = height;

      color = if node.data.first then "blue" else "green"
      util.roundRect(ctx, point, width+(MARGIN*2), height, color, 10)



  drawNode: (node, point) ->
      MARGIN = 10
      nodeView = view node.data
      ctx.font = "10pt Times"
      {width, height, count} = util.textSize ctx, nodeView
