fix: correctly hide lifelines with _hide
This commit is contained in:
@@ -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
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user