From: Tara L Andrews Date: Mon, 12 Mar 2012 15:43:45 +0000 (+0100) Subject: use the straighten hack whenever explicitly specified, subgraph or no X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6648ee3de96b0a0647a59b22782261c2e4c71138;p=scpubgit%2Fstemmatology.git use the straighten hack whenever explicitly specified, subgraph or no --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index 7e9a3a5..7c22786 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -594,6 +594,7 @@ sub as_dot { my $color_common = $opts->{'color_common'} if $opts; my $STRAIGHTENHACK = !$startrank && !$endrank && $self->end->rank && $self->end->rank > 100; + $STRAIGHTENHACK = 1 if $opts->{'straight'}; # even for subgraphs or small graphs # Check the arguments if( $startrank ) { @@ -638,7 +639,8 @@ sub as_dot { } if( $STRAIGHTENHACK ) { ## HACK part 1 - $dot .= "\tsubgraph { rank=same \"#START#\" \"#SILENT#\" }\n"; + my $startlabel = $startrank ? 'SUBSTART' : 'START'; + $dot .= "\tsubgraph { rank=same \"#$startlabel#\" \"#SILENT#\" }\n"; $dot .= "\t\"#SILENT#\" [ shape=diamond,color=white,penwidth=0,label=\"\" ];" } my %used; # Keep track of the readings that actually appear in the graph @@ -719,7 +721,8 @@ sub as_dot { } # HACK part 2 if( $STRAIGHTENHACK ) { - $dot .= "\t\"#END#\" -> \"#SILENT#\" [ color=white,penwidth=0 ];\n"; + my $endlabel = $endrank ? 'SUBEND' : 'END'; + $dot .= "\t\"#$endlabel#\" -> \"#SILENT#\" [ color=white,penwidth=0 ];\n"; } $dot .= "}\n";