MCPcopy Create free account
hub / github.com/SplootCode/splootcode / getCapShape

Function getCapShape

packages/editor/src/components/node_block.tsx:29–45  ·  view source on GitHub ↗
(className: string, x: number, y: number, width: number, leftCurve: boolean)

Source from the content-addressed store, hash-verified

27}
28
29function getCapShape(className: string, x: number, y: number, width: number, leftCurve: boolean) {
30 let leftSide: string
31 if (leftCurve) {
32 leftSide = `a 20 20 0 0 1 0 ${NODE_BLOCK_HEIGHT}`
33 } else {
34 leftSide = `q -4,0 -4,4 v ${NODE_BLOCK_HEIGHT - 8} q 0,4 4,4`
35 width -= 4
36 x += 4
37 }
38
39 return (
40 <>
41 <path className={className} d={`M ${x} ${y} ${leftSide} h ${width} v ${-NODE_BLOCK_HEIGHT} z`} />
42 <line className={className + ' cap-line'} x1={x + width} y1={y} x2={x + width} y2={y + NODE_BLOCK_HEIGHT} />
43 </>
44 )
45}
46
47export function getNodeShape(
48 className: string,

Callers 1

renderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected