From 9275169e8c9f93420e07af9b8214f3bffa74f83c Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 6 Oct 2024 15:14:34 +0200 Subject: [PATCH] added auto participant creation for notes --- src/diagram.typ | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/diagram.typ b/src/diagram.typ index 8412d60..ba03faa 100644 --- a/src/diagram.typ +++ b/src/diagram.typ @@ -130,6 +130,21 @@ } else if elmt.side == "right" { linked.push("]") } + + let pars = none + if type(elmt.pos) == str { + pars = (elmt.pos,) + } else if type(elmt.pos) == array { + pars = elmt.pos + } + if pars != none { + for par in pars { + if not participant._exists(participants, par) { + participants.push(_par(par).first()) + } + } + } + last-note = ( elmt: elmt, i: i