(
{
id,
borderRadiusPath,
borderType,
left,
top,
width,
height,
}: {
id: string
borderRadiusPath?: string
borderType?: 'rect' | 'path'
left: number
top: number
width: number
height: number
},
style: Record<string, number | string>
)
| 67 | _radius && _radius[0] !== 0 && _radius[1] !== 0 |
| 68 | |
| 69 | export function getBorderRadiusClipPath( |
| 70 | { |
| 71 | id, |
| 72 | borderRadiusPath, |
| 73 | borderType, |
| 74 | left, |
| 75 | top, |
| 76 | width, |
| 77 | height, |
| 78 | }: { |
| 79 | id: string |
| 80 | borderRadiusPath?: string |
| 81 | borderType?: 'rect' | 'path' |
| 82 | left: number |
| 83 | top: number |
| 84 | width: number |
| 85 | height: number |
| 86 | }, |
| 87 | style: Record<string, number | string> |
| 88 | ) { |
| 89 | const rectClipId = `satori_brc-${id}` |
| 90 | const defs = buildXMLString( |
| 91 | 'clipPath', |
| 92 | { |
| 93 | id: rectClipId, |
| 94 | }, |
| 95 | buildXMLString(borderType, { |
| 96 | x: left, |
| 97 | y: top, |
| 98 | width, |
| 99 | height, |
| 100 | d: borderRadiusPath ? borderRadiusPath : undefined, |
| 101 | }) |
| 102 | ) |
| 103 | |
| 104 | return [defs, rectClipId] |
| 105 | } |
| 106 | |
| 107 | export default function radius( |
| 108 | { |
no test coverage detected
searching dependent graphs…