cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
809 stars 35 forks source link

No easy way to unset mark style #471

Open emilyyyylime opened 7 months ago

emilyyyylime commented 7 months ago

Using set-style(mark: none) appears to work at first but any proceeding uses of marks error

Example:


#import "@preview/cetz:0.2.0": draw, canvas
#canvas({
  set-style(mark: /* Some use; not necessary for bug. */)
  set-style(mark: none) // My first thought for how to unset the style
  line((0,0), (1,1), mark: (symbol: ">")) // boom :(
})
johannes-wolf commented 7 months ago

This is a bug, I guess we should either panic that the mark-style is none or not draw marks. But you can unset the mark style by setting mark: (begin: none, end: none). If you want to temporarily set a style, you can also use groups for scoping. Setting mark: none completely removes the style, I do not think this is what you want.

emilyyyylime commented 7 months ago

I think the least surprising behaviour here would be to reset the mark styles to the default