refactored groups, separators and delays

This commit is contained in:
2025-07-14 17:23:49 +02:00
parent babce5195e
commit aed215ff17
7 changed files with 202 additions and 180 deletions

27
src/core/draw/delay.typ Normal file
View File

@ -0,0 +1,27 @@
#import "../utils.typ": get-ctx, set-ctx
#import "../../cetz.typ": draw
#let render(delay) = get-ctx(ctx => {
let y0 = ctx.y
let y1 = ctx.y - delay.size
for (i, line) in ctx.lifelines.enumerate() {
line.lines.push(("delay-start", y0))
line.lines.push(("delay-end", y1))
ctx.lifelines.at(i) = line
}
if delay.name != none {
let x0 = ctx.x-pos.first()
let x1 = ctx.x-pos.last()
draw.content(
((x0 + x1) / 2, (y0 + y1) / 2),
anchor: "center",
delay.name
)
}
ctx.y = y1
set-ctx(c => {
c.y = ctx.y
c.lifelines = ctx.lifelines
return c
})
})