Add title padding

This commit is contained in:
Júlio César Batista 2022-12-02 18:39:29 -08:00
parent 4c44b9b367
commit b2e310d6ac
No known key found for this signature in database
GPG key ID: 10C4B861BF314878
6 changed files with 383 additions and 379 deletions

View file

@ -41,6 +41,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, layout func(ctx context.Conte
obj.Children = make(map[string]*d2graph.Object) obj.Children = make(map[string]*d2graph.Object)
obj.ChildrenArray = nil obj.ChildrenArray = nil
obj.Box = geo.NewBox(nil, sd.getWidth(), sd.getHeight()) obj.Box = geo.NewBox(nil, sd.getWidth(), sd.getHeight())
obj.LabelPosition = go2.Pointer(string(label.InsideTopCenter))
sequenceDiagrams[obj.AbsID()] = sd sequenceDiagrams[obj.AbsID()] = sd
for _, edge := range sd.messages { for _, edge := range sd.messages {

View file

@ -89,8 +89,11 @@ func newSequenceDiagram(actors []*d2graph.Object, messages []*d2graph.Edge) *seq
sd.actorXStep = math.Max(sd.actorXStep, distributedLabelWidth+HORIZONTAL_PAD) sd.actorXStep = math.Max(sd.actorXStep, distributedLabelWidth+HORIZONTAL_PAD)
} }
sd.maxActorHeight += VERTICAL_PAD
sd.messageYStep += VERTICAL_PAD sd.messageYStep += VERTICAL_PAD
sd.maxActorHeight += VERTICAL_PAD
if sd.root.LabelHeight != nil {
sd.maxActorHeight += float64(*sd.root.LabelHeight)
}
return sd return sd
} }

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 498 KiB

After

Width:  |  Height:  |  Size: 498 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 498 KiB

After

Width:  |  Height:  |  Size: 498 KiB