Skip to content

Commit

Permalink
ta
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Feb 3, 2025
1 parent b27235a commit 9cff0ee
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 87 deletions.
11 changes: 7 additions & 4 deletions d2layouts/d2near/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,15 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) {
}

for _, edge := range g.Edges {
if edge.Src.OuterNearContainer() != nil || edge.Dst.OuterNearContainer() != nil {
continue
}
if edge.Route != nil {
for _, point := range edge.Route {
x1 = math.Min(x1, point.X-pad/2)
y1 = math.Min(y1, point.Y-pad/2)
x2 = math.Max(x2, point.X+pad/2)
y2 = math.Max(y2, point.Y+pad/2)
x1 = math.Min(x1, point.X)
y1 = math.Min(y1, point.Y)
x2 = math.Max(x2, point.X)
y2 = math.Max(y2, point.Y)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions e2etests/testdata/txtar/elk-title-near/elk/board.exp.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9cff0ee

Please sign in to comment.