forked from HEL/chronos
@@ -2,6 +2,7 @@
|
||||
|
||||
#import "draw/note.typ": get-box as get-note-box, get-size as get-note-size
|
||||
#import "draw/participant.typ"
|
||||
#import "draw/sync.typ": in-sync-render
|
||||
#import "utils.typ": *
|
||||
#import "/src/consts.typ": *
|
||||
|
||||
@@ -15,22 +16,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
#let unwrap-syncs(elements) = {
|
||||
let i = 0
|
||||
while i < elements.len() {
|
||||
let elmt = elements.at(i)
|
||||
if elmt.type == "sync" {
|
||||
elements = (
|
||||
elements.slice(0, i + 1) +
|
||||
elmt.elmts +
|
||||
elements.slice(i + 1)
|
||||
)
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
return elements
|
||||
}
|
||||
|
||||
#let seq-update-lifelines(participants, pars-i, seq) = {
|
||||
let participants = participants
|
||||
let com = if seq.comment == none {""} else {seq.comment}
|
||||
@@ -308,7 +293,6 @@
|
||||
|
||||
#let compute-columns-width(participants, elements, pars-i) = {
|
||||
elements = elements.filter(is-elmt)
|
||||
elements = unwrap-syncs(elements)
|
||||
|
||||
let cells
|
||||
(participants, elements, cells) = compute-max-lifeline-levels(participants, elements, pars-i)
|
||||
@@ -334,7 +318,8 @@
|
||||
lifelines: participants.map(_ => (
|
||||
level: 0,
|
||||
lines: ()
|
||||
))
|
||||
)),
|
||||
in-sync: false
|
||||
)
|
||||
chronos-ctx.insert(
|
||||
"widths",
|
||||
@@ -393,7 +378,13 @@
|
||||
if not is-elmt(elmt) {
|
||||
(elmt,)
|
||||
} else if "draw" in elmt and elmt.type != "par" {
|
||||
(elmt.draw)(elmt)
|
||||
get-ctx(ctx => {
|
||||
if ctx.in-sync and elmt.type != "sync-end" {
|
||||
in-sync-render(elmt)
|
||||
} else {
|
||||
(elmt.draw)(elmt)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user