Skip to content

Commit

Permalink
d2sequence: fix self reference message alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Aug 4, 2024
1 parent 9b83a0f commit 9575dfd
Show file tree
Hide file tree
Showing 31 changed files with 2,816 additions and 1,115 deletions.
7 changes: 2 additions & 5 deletions d2layouts/d2sequence/sequence_diagram.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ func (sd *sequenceDiagram) placeSpans() {
// in another step, routes are adjusted to spans borders when necessary
func (sd *sequenceDiagram) routeMessages() error {
var prevIsLoop bool
var prevGroup *d2graph.Object
messageOffset := sd.maxActorHeight + sd.yStep
for _, message := range sd.messages {
message.ZIndex = MESSAGE_Z_INDEX
Expand All @@ -547,12 +546,10 @@ func (sd *sequenceDiagram) routeMessages() error {
}
}

// we need extra space if the previous message is a loop in a different group
group := message.GetGroup()
if prevIsLoop && prevGroup != group {
// we need extra space if the previous message is a loop
if prevIsLoop {
messageOffset += MIN_MESSAGE_DISTANCE
}
prevGroup = group

startY := messageOffset + noteOffset

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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

Loading

0 comments on commit 9575dfd

Please sign in to comment.