From e01d18044568896ec872c4b4cf5ccee414146d4b Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 7 Apr 2026 14:38:51 +0200 Subject: [PATCH] fix: correctly hide lifelines with _hide --- src/core/draw/hide.typ | 6 ++++++ src/core/draw/participant.typ | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/core/draw/hide.typ b/src/core/draw/hide.typ index 2942acd..1f99c44 100644 --- a/src/core/draw/hide.typ +++ b/src/core/draw/hide.typ @@ -3,6 +3,9 @@ #let render(sync) = get-ctx(ctx => { set-ctx(c => { c.hidden = true + for i in range(c.lifelines.len()) { + c.lifelines.at(i).lines.push(("hide",)) + } return c }) }) @@ -10,6 +13,9 @@ #let render-end(sync) = get-ctx(ctx => { set-ctx(c => { c.hidden = false + for i in range(c.lifelines.len()) { + c.lifelines.at(i).lines.push(("unhide",)) + } return c }) }) diff --git a/src/core/draw/participant.typ b/src/core/draw/participant.typ index d7c87e3..3a1374e 100644 --- a/src/core/draw/participant.typ +++ b/src/core/draw/participant.typ @@ -320,9 +320,20 @@ let destructions = () let lines = () + let hidden = false + // Compute lifeline rectangles + destruction positions for line in ctx.lifelines.at(p.i).lines { let event = line.first() + if event == "hide" { + hidden = true + } else if event == "unhide" { + hidden = false + } + if hidden and event in ("create", "enable") { + continue + } + if event == "create" { last-y = line.at(1)