feat: support opacity

This commit is contained in:
Anthony Fu
2024-02-24 16:17:06 +01:00
parent b572eca81d
commit 3bce13f65f
3 changed files with 7 additions and 3 deletions

View File

@@ -225,6 +225,8 @@ export function renderAnnotation(
setAttr(path, 'fill', 'none')
setAttr(path, 'stroke', config.color || 'currentColor')
setAttr(path, 'stroke-width', `${strokeWidth}`)
if (config.opacity !== undefined)
setAttr(path, 'style', `opacity:${config.opacity}`)
if (animate) {
const length = path.getTotalLength()
lengths.push(length)