cetz
cetz copied to clipboard
proposal: Add drawable modifiers
As a way to generalise such things as marks and decorations we should have element modifiers. It would come in the form of a single function that takes an element's drawables, ctx and the element's styling (and possibly the name and type of the element). Then return the modified drawables which can then be transformed and anchors applied to.
The function would then call modifier functions in ctx, depending on the state of the style dict (and other options like the name or type), to operate on the drawables.
This would:
- Replace how marks are done, and may change the outcome of #465.
- Allow new and custom user features that modify an element's path without having to wrap the draw function.