merged with-ctx-style and get-ctx
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#import "/src/cetz.typ": draw, styles
|
||||
|
||||
#import "/src/consts.typ": *
|
||||
#import "/src/core/utils.typ": normalize-units, set-y, with-ctx-style
|
||||
#import "/src/core/utils.typ": get-ctx, normalize-units, set-y
|
||||
|
||||
#let separator-default-style = (
|
||||
inset: (
|
||||
@@ -13,9 +13,9 @@
|
||||
outset: 20pt
|
||||
)
|
||||
|
||||
#let render(sep) = with-ctx-style((ctx, glob-style) => {
|
||||
#let render(sep) = get-ctx(ctx => {
|
||||
let style = styles.resolve(
|
||||
glob-style,
|
||||
ctx.style,
|
||||
merge: sep.style,
|
||||
root: "separator",
|
||||
base: separator-default-style
|
||||
@@ -23,7 +23,7 @@
|
||||
let gap = normalize-units(style.gap)
|
||||
let outset = normalize-units(style.outset)
|
||||
|
||||
ctx.y -= glob-style.y-space
|
||||
ctx.y -= ctx.style.y-space
|
||||
|
||||
let x0 = ctx.x-pos.first() - outset
|
||||
let x1 = ctx.x-pos.last() + outset
|
||||
|
Reference in New Issue
Block a user