refactored sequences, sync and gaps

This commit is contained in:
2025-07-14 16:30:25 +02:00
parent e27bb9a9eb
commit 3a1c274e83
10 changed files with 849 additions and 401 deletions

View File

@ -379,13 +379,9 @@
// Draw elements
for elmt in elements {
if not is-elmt(elmt) {
shapes.push(elmt)
// Sequences
} else if elmt.type == "seq" {
let shps
(y, lifelines, shps) = draw-seq(elmt, y, lifelines)
shapes += shps
(elmt,)
} else if "draw" in elmt and elmt.type != "par" {
(elmt.draw)(elmt)
// Groups (start) -> reserve space for labels + store position
} else if elmt.type == "grp" {
@ -440,10 +436,6 @@
let shps
(y, shps) = draw-sep(elmt, y)
shapes += shps
// Gap
} else if elmt.type == "gap" {
y -= elmt.size
// Delay
} else if elmt.type == "delay" {
@ -465,30 +457,6 @@
}
y = y1
// Event
} else if elmt.type == "evt" {
let par-name = elmt.participant
let i = pars-i.at(par-name)
let par = participants.at(i)
let line = lifelines.at(i)
if elmt.event == "disable" {
line.level -= 1
line.lines.push(("disable", y))
} else if elmt.event == "destroy" {
line.lines.push(("destroy", y))
} else if elmt.event == "enable" {
line.level += 1
line.lines.push(("enable", y, elmt.lifeline-style))
} else if elmt.event == "create" {
y -= CREATE-OFFSET
shapes += participant.render(x-pos, par, y: y)
line.lines.push(("create", y))
}
lifelines.at(i) = line
// Note
} else if elmt.type == "note" {
if not elmt.linked {
@ -499,12 +467,6 @@
(y, shps) = draw-note(elmt, y, lifelines)
shapes += shps
}
// Synched sequences
} else if elmt.type == "sync" {
let shps
(y, lifelines, shps) = draw-sync(elmt, y, lifelines)
shapes += shps
}
}