fixed some spacing issues
This commit is contained in:
@ -86,6 +86,21 @@
|
||||
)
|
||||
}
|
||||
|
||||
// Compute minimum width for self sequences
|
||||
for cell in cells.filter(c => c.i1 == c.i2) {
|
||||
let m = measure(cell.cell)
|
||||
let i = cell.i1
|
||||
if cell.elmt.flip {
|
||||
i -= 1
|
||||
}
|
||||
if 0 <= i and i < widths.len() {
|
||||
widths.at(i) = calc.max(
|
||||
widths.at(i),
|
||||
m.width / 1pt + COMMENT-PAD
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Compute remaining widths for longer sequences (spanning multiple columns)
|
||||
let multicol-cells = cells.filter(c => c.i2 - c.i1 > 1)
|
||||
multicol-cells = multicol-cells.sorted(key: c => {
|
||||
@ -136,7 +151,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
let y = -Y-SPACE
|
||||
let y = 0
|
||||
let groups = ()
|
||||
let lifelines = participants.map(_ => (
|
||||
level: 0,
|
||||
@ -153,6 +168,7 @@
|
||||
|
||||
// Groups (start) -> reserve space for labels + store position
|
||||
} else if elmt.type == "grp" {
|
||||
y -= Y-SPACE
|
||||
let m = measure(
|
||||
box(
|
||||
elmt.name,
|
||||
@ -165,17 +181,16 @@
|
||||
g
|
||||
})
|
||||
groups.push((y, elmt, 0, 0))
|
||||
y -= m.height / 1pt + Y-SPACE
|
||||
y -= m.height / 1pt
|
||||
|
||||
// Groups (end) -> actual drawing
|
||||
} else if elmt.type == "grp-end" {
|
||||
y -= Y-SPACE
|
||||
let (start-y, group, start-lvl, end-lvl) = groups.pop()
|
||||
let x0 = x-pos.at(group.min-i) - start-lvl * 10 - 20
|
||||
let x1 = x-pos.at(group.max-i) + end-lvl * 10 + 20
|
||||
shapes += draw-group(x0, x1, start-y, y, group)
|
||||
|
||||
y -= Y-SPACE
|
||||
|
||||
// Separator
|
||||
} else if elmt.type == "sep" {
|
||||
let shps
|
||||
@ -211,6 +226,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
y -= Y-SPACE
|
||||
|
||||
// Draw vertical lines + lifelines + end participants
|
||||
shapes += draw.on-layer(-1, {
|
||||
if DEBUG-INVISIBLE {
|
||||
|
Reference in New Issue
Block a user