   drawBranch : (decision, left, right, top, mode) ->
 
     branchMiddle = @calculateBranchMiddle(decision, left, right)
-    topChildren = @calculateChildTreeTop(mode, decision.chainCount, top)
+    topChildren = @calculateChildTop(decision.chainCount, top, mode)
     leftTree = @drawTreeWithWidths(decision.node.children[0], left,  branchMiddle, topChildren, mode)
     rightTree = @drawTreeWithWidths(decision.node.children[1], branchMiddle, right, topChildren, mode)
 

    return (left + right) / 2


  # Calculate the top of the children
  calculateChildTreeTop : (mode, chainCount, top) ->

    if mode == @MODE_NORMAL or chainCount < 3
      return top + (chainCount + 1) * @nodeDistance
    else if mode == @MODE_NOCHAIN
      return top + 3 * @nodeDistance


  clearBackground : ->


  drawCommentChain : (decision, left, right, top, mode) ->

    topChild = @calculateTop(decision.chainCount, top, mode)
    extent = @drawTreeWithWidths(decision.node, left, right, topChild, mode)
    return extent.middle

