|
@@ -95,7 +95,11 @@ public class BlockCalc implements AlgorithmStage {
|
|
|
{
|
|
|
if( current.getAlignedTo( layout ) == current )
|
|
|
{
|
|
|
- LayeredGraphNode u = incommingEdges.get( m - 1 ).getSources().get( 0 );
|
|
|
+ LayeredGraphNode u = null;
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_LEFT || layout == LayoutType.TOP_BOTTOM_RIGHT )
|
|
|
+ u = incommingEdges.get( m - 1 ).getSources().get( 0 );
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_LEFT || layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
|
+ u = incommingEdges.get( m - 1 ).getTargets().get( 0 );
|
|
|
ArrayList<LayeredGraphEdge> conflicts = incommingEdges.get( m - 1 ).calcConflictedEdges();
|
|
|
if( !incommingEdges.get( m - 1 ).isConflicted() && r < graph.getContainedLayers().get( calcBeforeLayerIndex() ).indexOf( u ) + 1 )
|
|
|
{
|
|
@@ -117,11 +121,12 @@ public class BlockCalc implements AlgorithmStage {
|
|
|
current.setAlignTo( current.getRoot( layout ), layout );
|
|
|
r = graph.getContainedLayers().get( calcBeforeLayerIndex() ).indexOf( u ) + 1;
|
|
|
int oldStep = step++;
|
|
|
+ final LayeredGraphNode uf = u;
|
|
|
backwards.add( 0, () -> {
|
|
|
System.out.println( "Stepping Backwards... (Step " + oldStep + ")" );
|
|
|
for( int i = 0; i < conflicts.size(); i++ )
|
|
|
conflicts.get( i ).setConflicted( oldConflicts.get( i ) );
|
|
|
- u.setAlignTo( oldAlignU, layout );
|
|
|
+ uf.setAlignTo( oldAlignU, layout );
|
|
|
current.setColor( oldColorCurrent, layout );
|
|
|
current.setRoot( oldRootCurrent, layout );
|
|
|
current.setAlignTo( oldAlignCurrent, layout );
|