lib/rsyntaxtree/tree_graph.rb
# Draw a triangle between child/parent elements
Draw a triangle between child/parent elements
Draw a triangle between child / parent elements
def triangle_to_parent(fromX, fromY, fromW, textW, symmetrize = true)
    if (fromY == 0)
      return
    end
    toX = fromX
    fromCenter = (fromX + fromW / 2 + @m[:b_side])
    fromTop  = row2px(fromY).ceil
    fromLeft1 = (fromCenter + textW / 2).ceil
    fromLeft2 = (fromCenter - textW / 2).ceil
    toBot    = (row2px(fromY - 1) + @e_height)
    if symmetrize
      toLeft   = (toX + textW / 2 + @m[:b_side])
    else
      toLeft   = (toX + textW / 2 + @m[:b_side] * 3)
    end
    @gc.fill("none")
    @gc.stroke @col_line
    @gc.stroke_width 1
    @gc.line(fromLeft1, fromTop, toLeft, toBot)
    @gc.line(fromLeft2, fromTop, toLeft, toBot)
    @gc.line(fromLeft1, fromTop, fromLeft2, fromTop)
  end
def triangle_to_parent ( fromX , fromY , fromW , textW , symmetrize = true ) if ( fromY == 0 ) return end toX = fromX fromCenter = ( fromX + fromW / 2 + @m [ :b_side ] ) fromTop = row2px ( fromY ) . ceil fromLeft1 = ( fromCenter + textW / 2 ) . ceil fromLeft2 = ( fromCenter - textW / 2 ) . ceil toBot = ( row2px ( fromY - 1 ) + @e_height ) if symmetrize toLeft = ( toX + textW / 2 + @m [ :b_side ] ) else toLeft = ( toX + textW / 2 + @m [ :b_side ] * 3 ) end @gc . fill ( "none" ) @gc . stroke @col_line @gc . stroke_width 1 @gc . line ( fromLeft1 , fromTop , toLeft , toBot ) @gc . line ( fromLeft2 , fromTop , toLeft , toBot ) @gc . line ( fromLeft1 , fromTop , fromLeft2 , fromTop ) end
Draw a triangle between child/parent elements
Draw a triangle between child / parent elements
fromX
<not_specific>
fromY
<not_specific>
fromW
<not_specific>
textW
<not_specific>
symmetrize
<not_specific>