lib/rsyntaxtree/svg_graph.rb
# Draw a line between child/parent elements
Draw a line between child/parent elements
Draw a line between child / parent elements
def line_to_parent(fromX, fromY, fromW, toX, toW)
    if (fromY == 0 )
      return
    end
    fromTop  = row2px(fromY)
    fromLeft = (fromX + fromW / 2 + @m[:b_side])
    toBot    = (row2px(fromY - 1 ) + @e_height)
    toLeft  = (toX + toW / 2 + @m[:b_side])
    line_data   = @line_styles.sub(/X1/, fromLeft.ceil.to_s)
    line_data   = line_data.sub(/Y1/, fromTop.ceil.to_s)
    line_data   = line_data.sub(/X2/, toLeft.ceil.to_s)
    @tree_data += line_data.sub(/Y2/, toBot.ceil.to_s)
  end
def line_to_parent ( fromX , fromY , fromW , toX , toW ) if ( fromY == 0 ) return end fromTop = row2px ( fromY ) fromLeft = ( fromX + fromW / 2 + @m [ :b_side ] ) toBot = ( row2px ( fromY - 1 ) + @e_height ) toLeft = ( toX + toW / 2 + @m [ :b_side ] ) line_data = @line_styles . sub ( / X1 / , fromLeft . ceil . to_s ) line_data = line_data . sub ( / Y1 / , fromTop . ceil . to_s ) line_data = line_data . sub ( / X2 / , toLeft . ceil . to_s ) @tree_data += line_data . sub ( / Y2 / , toBot . ceil . to_s ) end
Draw a line between child/parent elements
Draw a line between child / parent elements
fromX
<not_specific>
fromY
<not_specific>
fromW
<not_specific>
toX
<not_specific>
toW
<not_specific>