Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No easy way to unset mark style #471

Open
emilyyyylime opened this issue Jan 18, 2024 · 2 comments
Open

No easy way to unset mark style #471

emilyyyylime opened this issue Jan 18, 2024 · 2 comments
Labels
bug 🐛 Something isn't working core:draw ✏️

Comments

@emilyyyylime
Copy link

emilyyyylime commented Jan 18, 2024

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 johannes-wolf added bug 🐛 Something isn't working core:draw ✏️ labels Jan 18, 2024
@johannes-wolf
Copy link
Member

johannes-wolf commented Jan 18, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working core:draw ✏️
Projects
None yet
Development

No branches or pull requests

2 participants