refactored participant rendering

This commit is contained in:
2025-07-19 17:13:56 +02:00
parent d6aeb33fa5
commit 5b57a89cdd
13 changed files with 592 additions and 337 deletions

View File

@ -155,7 +155,7 @@
let m2 = participant.get-size(p2)
let w1 = m1.width
let w2 = m2.width
widths.push(w1 / 2pt + w2 / 2pt + PAR-SPACE)
widths.push(w1 / 2 + w2 / 2 + PAR-SPACE)
}
return widths
}
@ -326,6 +326,12 @@
#let setup-ctx(participants, elements) = (ctx => {
let state = ctx.at("shared-state", default: (:))
let (elements, participants) = participant.pre-resolve-styles(
extract-ctx(ctx, with-style: true),
elements,
participants
)
let chronos-ctx = (
participants: init-lifelines(participants),
pars-i: get-participants-i(participants),
@ -382,7 +388,8 @@
// Draw participants (start)
get-ctx(ctx => {
for p in ctx.participants {
if p.from-start and not p.invisible and p.show-top {
let style = p.resolved-style
if style.from-start and not p.invisible and style.show-top {
(p.draw)(p)
}
}