# Recursively draw children of mentity
fun draw_children(mentity: MEntity, max_depth: nullable Int, current_depth: nullable Int) do
if done_children.has(mentity) then return
done_children.add mentity
current_depth = current_depth or else 0
if max_depth != null and current_depth >= max_depth then
to_dotdotdot(mentity)
return
end
var children = mentity.collect_children(mainmodule, filter)
if children.length > 10 then
to_dotdotdot(mentity)
return
end
for child in children do
if child isa MGroup then
if child.mpackage.mgroups.first == child then child = child.mpackage
end
draw_edge(child, mentity)
end
for child in children do
if child isa MGroup then
if child.mpackage.mgroups.first == child then child = child.mpackage
end
draw_children(child, max_depth, current_depth + 1)
end
end
src/doc/commands/commands_graph.nit:261,2--287,4