This commit is contained in:
Alexander Wang 2025-02-03 16:50:27 -07:00
parent b27235a476
commit 9cff0eeaa6
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
3 changed files with 90 additions and 87 deletions

View file

@ -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)
}
}
}

View file

@ -15,8 +15,8 @@
"id": "title",
"type": "rectangle",
"pos": {
"x": -100,
"y": -84
"x": -95,
"y": -74
},
"width": 408,
"height": 66,

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB