fix: correctly hide lifelines with _hide
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
#let render(sync) = get-ctx(ctx => {
|
#let render(sync) = get-ctx(ctx => {
|
||||||
set-ctx(c => {
|
set-ctx(c => {
|
||||||
c.hidden = true
|
c.hidden = true
|
||||||
|
for i in range(c.lifelines.len()) {
|
||||||
|
c.lifelines.at(i).lines.push(("hide",))
|
||||||
|
}
|
||||||
return c
|
return c
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -10,6 +13,9 @@
|
|||||||
#let render-end(sync) = get-ctx(ctx => {
|
#let render-end(sync) = get-ctx(ctx => {
|
||||||
set-ctx(c => {
|
set-ctx(c => {
|
||||||
c.hidden = false
|
c.hidden = false
|
||||||
|
for i in range(c.lifelines.len()) {
|
||||||
|
c.lifelines.at(i).lines.push(("unhide",))
|
||||||
|
}
|
||||||
return c
|
return c
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -320,9 +320,20 @@
|
|||||||
let destructions = ()
|
let destructions = ()
|
||||||
let lines = ()
|
let lines = ()
|
||||||
|
|
||||||
|
let hidden = false
|
||||||
|
|
||||||
// Compute lifeline rectangles + destruction positions
|
// Compute lifeline rectangles + destruction positions
|
||||||
for line in ctx.lifelines.at(p.i).lines {
|
for line in ctx.lifelines.at(p.i).lines {
|
||||||
let event = line.first()
|
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" {
|
if event == "create" {
|
||||||
last-y = line.at(1)
|
last-y = line.at(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user