merged with-ctx-style and get-ctx
This commit is contained in:
@ -112,6 +112,13 @@
|
||||
|
||||
#let get-ctx(func) = draw.get-ctx(c => {
|
||||
let ctx = extract-ctx(c)
|
||||
ctx.style = styles.resolve(
|
||||
c.style,
|
||||
root: "chronos",
|
||||
base: default-style
|
||||
)
|
||||
// Normalize because it is used very frequently
|
||||
ctx.style.y-space = normalize-units(ctx.style.y-space)
|
||||
func(ctx)
|
||||
})
|
||||
|
||||
@ -129,17 +136,3 @@
|
||||
}
|
||||
return ctx
|
||||
})
|
||||
|
||||
#let with-ctx-style(func) = draw.get-ctx(cetz-ctx => {
|
||||
let ctx = extract-ctx(cetz-ctx)
|
||||
let glob-style = styles.resolve(
|
||||
cetz-ctx.style,
|
||||
root: "chronos",
|
||||
base: default-style
|
||||
)
|
||||
|
||||
// Normalize because it is used very frequently
|
||||
glob-style.y-space = normalize-units(glob-style.y-space)
|
||||
|
||||
func(ctx, glob-style)
|
||||
})
|
Reference in New Issue
Block a user