forked from HEL/chronos
base for CeTZ integration
migrated contextual variables to CeTZ context shared-state adapted participant rendering
This commit is contained in:
@ -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)
|
||||
})
|
Reference in New Issue
Block a user