From: Tara L Andrews Date: Thu, 2 Feb 2012 23:23:11 +0000 (+0100) Subject: only run the hack for larger graphs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8960ee08ff09bf52e8328d91ba763497ca0added;p=scpubgit%2Fstemmatology.git only run the hack for larger graphs --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 8a05147..39dd83e 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -486,6 +486,8 @@ sub as_dot { my $startrank = $opts->{'from'} if $opts; my $endrank = $opts->{'to'} if $opts; my $color_common = $opts->{'color_common'} if $opts; + my $STRAIGHTENHACK = !$startrank && !$endrank && $self->end->rank + && $self->end->rank > 100; # Check the arguments if( $startrank ) { @@ -529,7 +531,7 @@ sub as_dot { if( $endrank ) { $dot .= "\t\"#SUBEND#\" [ label=\"...\" ];\n"; } - if( !$startrank && !$endrank ) { + if( $STRAIGHTENHACK ) { ## HACK part 1 $dot .= "\tsubgraph { rank=same \"#START#\" \"#SILENT#\" }\n"; $dot .= "\t\"#SILENT#\" [ color=white,penwidth=0,label=\"\" ];" @@ -593,7 +595,7 @@ sub as_dot { $dot .= "\t\"$node\" -> \"#SUBEND#\" $varopts;"; } # HACK part 2 - if( !$startrank && !$endrank ) { + if( $STRAIGHTENHACK ) { $dot .= "\t\"#END#\" -> \"#SILENT#\" [ color=white,penwidth=0 ];\n"; }