MCPcopy
hub / github.com/vercel/satori / getBorderRadiusClipPath

Function getBorderRadiusClipPath

src/builder/border-radius.ts:69–105  ·  view source on GitHub ↗
(
  {
    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>
)

Source from the content-addressed store, hash-verified

67 _radius && _radius[0] !== 0 && _radius[1] !== 0
68
69export 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
107export default function radius(
108 {

Callers 1

rectFunction · 0.85

Calls 1

buildXMLStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…