GT-3153 - Function Graph - fixed bug exposed by extra wide vertices when

routing upwards
This commit is contained in:
dragonmacher 2019-09-13 17:10:18 -04:00
parent 68108b088e
commit 69ec52354c

View file

@ -569,17 +569,26 @@ public class DecompilerNestedLayout extends AbstractFGLayout {
startRow = end.rowIndex; startRow = end.rowIndex;
} }
List<Vertex2d> toCheck = new LinkedList<>();
for (int row = startRow + 1; row < endRow; row++) { for (int row = startRow + 1; row < endRow; row++) {
// assume any other vertex in our column can clip (it will not clip when // assume any other vertex in our column can clip (it will not clip when
// the 'spacing' above pushes the edge away from this column, like for // the 'spacing' above pushes the edge away from this column, like for
// large row delta values) // large row delta values)
Vertex2d otherVertex = vertex2dFactory.get(row, column); Vertex2d otherVertex = vertex2dFactory.get(row, column);
if (otherVertex == null) { if (otherVertex != null) {
continue; // no vertex in this cell toCheck.add(otherVertex);
} }
}
// always process the vertices from the start vertex so that the articulation adjustments
// are correct
if (!goingDown) {
Collections.reverse(toCheck);
}
int delta = endRow - startRow;
for (Vertex2d otherVertex : toCheck) {
int delta = endRow - startRow;
int padding = VERTEX_TO_EDGE_AVOIDANCE_PADDING; int padding = VERTEX_TO_EDGE_AVOIDANCE_PADDING;
int distanceSpacing = padding + delta; // adding the delta makes overlap less likely int distanceSpacing = padding + delta; // adding the delta makes overlap less likely
@ -608,7 +617,6 @@ public class DecompilerNestedLayout extends AbstractFGLayout {
if (vertexClipper.isClippingX(otherVertex, edgeX)) { if (vertexClipper.isClippingX(otherVertex, edgeX)) {
/* /*
Must route around this vertex - new points: Must route around this vertex - new points:
-p1 - just above the intersection point -p1 - just above the intersection point
-p2 - just past the left edge -p2 - just past the left edge