lib/rsyntaxtree/svg_graph.rb
# If a node element text is wider than the sum of it's
#   child elements, then the child elements need to
#   be resized to even out the space. This function
#   recurses down the a child tree and sizes the
#   children appropriately.
If a node element text is wider than the sum of it's
child elements, then the child elements need to
be resized to even out the space. This function
recurses down the a child tree and sizes the
children appropriately.
If a node element text is wider than the sum of it ' s child elements then the child elements need to be resized to even out the space . This function recurses down the a child tree and sizes the children appropriately .
def fix_child_size(id, current, target)
    children = @e_list.get_children(id)
    @e_list.set_element_width(id, target)
    if(children.length > 0 ) 
      delta = target - current
      target_delta = delta / children.length 
      children.each do |child|
        child_width = @e_list.get_element_width(child)
        fix_child_size(child, child_width, child_width + target_delta)
      end
    end
  end
def fix_child_size ( id , current , target ) children = @e_list . get_children ( id ) @e_list . set_element_width ( id , target ) if ( children . length > 0 ) delta = target - current target_delta = delta / children . length children . each do | child | child_width = @e_list . get_element_width ( child ) fix_child_size ( child , child_width , child_width + target_delta ) end end end
If a node element text is wider than the sum of it's
child elements, then the child elements need to
be resized to even out the space.
If a node element text is wider than the sum of it ' s child elements then the child elements need to be resized to even out the space .
id
<not_specific>
current
<not_specific>
target
<not_specific>