cetz
cetz copied to clipboard
Centering dashed strokes (like TikZ's `dash expand off`)
hi! it would be cool to have an equivalent of TikZ's dash expand off that "centers" the dashes of a stroke such that both of its edges have equal spacing, which can result in nicer lines (e.g. the bottom line here looks a little weird)
code
#import "@preview/cetz:0.4.2"
#cetz.canvas({
import cetz.draw: *
set-style(mark: (symbol: "|", stroke: (dash: none)), stroke: (dash: "dashed"))
line((0pt, .2), (53pt, .2))
line((0pt, 0), (62pt, 0))
})