Skip to content

Commit

Permalink
fixed same issue when recursing through edges with targets within
Browse files Browse the repository at this point in the history
non-expanded nodes. Added a check to avoid further NPEs at this place.
  • Loading branch information
NiklasRentzCAU committed Apr 5, 2024
1 parent 8ab89d5 commit 2ba8ab0
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ final class RenderingPreparer {
}
}
for (edge : element.outgoingEdges) {
prepareRendering(edge, kGraphToSGraph)
// not expanded => edge must not have the target node inside the non-expanded
if (isExpanded || !KGraphUtil.isDescendant(edge.target, element)) {
prepareRendering(edge, kGraphToSGraph)
}
}
for (port : element.ports) {
prepareRendering(port, kGraphToSGraph)
Expand Down Expand Up @@ -382,10 +385,11 @@ final class RenderingPreparer {
var List<Point2D.Float> pointList = new ArrayList()
if (parent instanceof KEdge) {
val edge = parent as KEdge

pointList.add(new Point2D.Float(edge.sourcePoint.x, edge.sourcePoint.y))
pointList.addAll(edge.bendPoints.map[ new Point2D.Float(it.x, it.y) ])
pointList.add(new Point2D.Float(edge.targetPoint.x, edge.targetPoint.y))
if (edge.sourcePoint !== null && edge.targetPoint !== null) {
pointList.add(new Point2D.Float(edge.sourcePoint.x, edge.sourcePoint.y))
pointList.addAll(edge.bendPoints.map[ new Point2D.Float(it.x, it.y) ])
pointList.add(new Point2D.Float(edge.targetPoint.x, edge.targetPoint.y))
}
} else if (!parentRendering.points.empty) {
pointList.addAll(parentRendering.points.map[position |
PlacementUtil.evaluateKPosition(position, parentBounds, true).toPoint2D])
Expand Down

0 comments on commit 2ba8ab0

Please sign in to comment.