base for CeTZ integration

migrated contextual variables to CeTZ context shared-state
adapted participant rendering
This commit is contained in:
2025-07-14 15:40:21 +02:00
parent 4f916359a9
commit e27bb9a9eb
3 changed files with 74 additions and 425 deletions

View File

@ -1,3 +1,5 @@
#import "../cetz.typ": draw
#let is-elmt(elmt) = {
if type(elmt) != dictionary {
return false
@ -89,4 +91,16 @@
height: new-h,
scale(x: r, y: r, reflow: true, canvas)
)
})
#let set-ctx(func) = draw.set-ctx(c => {
let ctx = c.shared-state.chronos
ctx = func(ctx)
c.shared-state.chronos = ctx
return c
})
#let get-ctx(func) = draw.get-ctx(c => {
let ctx = c.shared-state.chronos
func(ctx)
})