(
{
id,
content,
filter,
left,
top,
width,
height,
matrix,
opacity,
image,
clipPathId,
debug,
shape,
decorationShape,
}: {
content: string
filter: string
id: string
left: number
top: number
width: number
height: number
matrix: string
opacity: number
image: string | null
clipPathId?: string
debug?: boolean
shape?: boolean
decorationShape?: string
},
style: Record<string, number | string>
)
| 44 | } |
| 45 | |
| 46 | export default function buildText( |
| 47 | { |
| 48 | id, |
| 49 | content, |
| 50 | filter, |
| 51 | left, |
| 52 | top, |
| 53 | width, |
| 54 | height, |
| 55 | matrix, |
| 56 | opacity, |
| 57 | image, |
| 58 | clipPathId, |
| 59 | debug, |
| 60 | shape, |
| 61 | decorationShape, |
| 62 | }: { |
| 63 | content: string |
| 64 | filter: string |
| 65 | id: string |
| 66 | left: number |
| 67 | top: number |
| 68 | width: number |
| 69 | height: number |
| 70 | matrix: string |
| 71 | opacity: number |
| 72 | image: string | null |
| 73 | clipPathId?: string |
| 74 | debug?: boolean |
| 75 | shape?: boolean |
| 76 | decorationShape?: string |
| 77 | }, |
| 78 | style: Record<string, number | string> |
| 79 | ) { |
| 80 | let extra = '' |
| 81 | if (debug) { |
| 82 | extra = buildXMLString('rect', { |
| 83 | x: left, |
| 84 | y: top - height, |
| 85 | width, |
| 86 | height, |
| 87 | fill: 'transparent', |
| 88 | stroke: '#575eff', |
| 89 | 'stroke-width': 1, |
| 90 | transform: matrix || undefined, |
| 91 | 'clip-path': clipPathId ? `url(#${clipPathId})` : undefined, |
| 92 | }) |
| 93 | } |
| 94 | |
| 95 | // This grapheme should be rendered as an image. |
| 96 | if (image) { |
| 97 | const shapeProps = { |
| 98 | href: image, |
| 99 | x: left, |
| 100 | y: top, |
| 101 | width, |
| 102 | height, |
| 103 | transform: matrix || undefined, |
no test coverage detected
searching dependent graphs…