From ef73f98dd0c747bcee91b2f896bf24a605a7d9c2 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Thu, 20 Jun 2024 18:02:13 +0200 Subject: [PATCH] minor fixes --- src/diagram.typ | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/diagram.typ b/src/diagram.typ index c44ad0d..1078454 100644 --- a/src/diagram.typ +++ b/src/diagram.typ @@ -22,9 +22,21 @@ while i < elmts.len() { let elmt = elmts.at(i) if elmt.type == "grp" { + let grp-elmts = elmt.elmts + elmt.elmts = elmt.elmts.map(e => { + if e.type == "seq" { + if e.p1 == "?" { + e.p1 = "?" + e.p2 + } else if e.p2 == "?" { + e.p2 = e.p1 + "?" + } + } + e + }) + elmts.at(i) = elmt elmts = ( elmts.slice(0, i + 1) + - elmt.elmts + + grp-elmts + (( type: "grp-end" ),) + @@ -46,6 +58,10 @@ if not participant._exists(participants, elmt.p2) { let par = _par(elmt.p2, from-start: not elmt.create-dst).first() participants.push(par) + + } else if elmt.create-dst { + let i = participants.position(p => p.name == elmt.p2) + participants.at(i).from-start = false } if elmt.p1 == "?" {