 
     (dx*dx + dy*dy < @radius*@radius)
 
+  forAll: (fn) ->
+    fn(this)
+    return
+
+  tryAll: (fn) ->
+    return fn(this)
+
   radius: 15
 
 class Leaf extends Node

        if mdx*mdx+mdy*mdy < 10*10
          # call it a click

          @merging =
            node: @selected.node
            x: pos.x
            y: pos.y

    @selected = null


          if n isnt @merging.node
            @mergeNodes(@merging.node, n)
            @merging = null

            return true

    if @merging?
      @merging = null

    # try moving nodes
    for n in @nodes
      hit = n.tryAll( (node) ->
        if node.isHit(pos)
          node
        else
          null
      )

      if hit?
        @selected =
          node: hit
          ox: hit.x # original location
          oy: hit.y
          mx: pos.x # mousedown location
          my: pos.y
          t: Date.now()
        return true

    return false

  mousemove: (pos) ->
    if @selected?
