This commit is contained in:
Alexander Wang 2023-02-09 19:19:40 -08:00
parent b02979f7e4
commit 2fb01f34a5
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE

View file

@ -221,9 +221,9 @@ func (sd *sequenceDiagram) placeGroup(group *d2graph.Object) {
if m.ContainedBy(group) { if m.ContainedBy(group) {
for _, p := range m.Route { for _, p := range m.Route {
minX = math.Min(minX, p.X-HORIZONTAL_PAD) minX = math.Min(minX, p.X-HORIZONTAL_PAD)
minY = math.Min(minY, p.Y-GROUP_LABEL_PADDING) minY = math.Min(minY, p.Y-MIN_MESSAGE_DISTANCE/2.)
maxX = math.Max(maxX, p.X+HORIZONTAL_PAD) maxX = math.Max(maxX, p.X+HORIZONTAL_PAD)
maxY = math.Max(maxY, p.Y+GROUP_LABEL_PADDING) maxY = math.Max(maxY, p.Y+MIN_MESSAGE_DISTANCE/2.)
} }
} }
} }
@ -245,9 +245,9 @@ func (sd *sequenceDiagram) placeGroup(group *d2graph.Object) {
} }
if inGroup { if inGroup {
minX = math.Min(minX, n.TopLeft.X-HORIZONTAL_PAD) minX = math.Min(minX, n.TopLeft.X-HORIZONTAL_PAD)
minY = math.Min(minY, n.TopLeft.Y-GROUP_LABEL_PADDING) minY = math.Min(minY, n.TopLeft.Y-MIN_MESSAGE_DISTANCE/2.)
maxX = math.Max(maxX, n.TopLeft.X+n.Width+HORIZONTAL_PAD) maxX = math.Max(maxX, n.TopLeft.X+n.Width+HORIZONTAL_PAD)
maxY = math.Max(maxY, n.TopLeft.Y+n.Height+GROUP_LABEL_PADDING) maxY = math.Max(maxY, n.TopLeft.Y+n.Height+MIN_MESSAGE_DISTANCE/2.)
} }
} }