1
0
Fork 0

Implement @eriese suggestion

This commit is contained in:
Wouter van Wageningen 2023-04-20 19:14:10 +00:00
parent 0213c92b0f
commit 9536476512
7 changed files with 103 additions and 30 deletions

View file

@ -1,18 +1,29 @@
const markers = `
const defs = [
{
name: 'notch',
def: `
<g id="notch">
<circle cy="0" cx="0" r="1.4" class="fill-note" />
<circle cy="0" cx="0" r="2.8" class="note" />
</g>
</g>`,
},
{
name: 'bnotch',
def: `
<g id="bnotch">
<path d="M -1.1 -1.1 L 1.1 1.1 M 1.1 -1.1 L -1.1 1.1" class="note" />
<circle cy="0" cx="0" r="2.8" class="note" />
</g>`
</g>`,
},
]
// Export hooks
export const notchesHooks = {
preRender: [
function (svg) {
svg.defs.setIfUnset('notch', markers)
for (const def of defs) {
svg.defs.setIfUnset(def.name, def.def)
}
},
],
}