chore(scripts): trim text-only bisect exports
This commit is contained in:
parent
51e961fc47
commit
977ccacf41
|
|
@ -176,15 +176,12 @@ async function exportOpenPencilSubset(indices: number[], path: string): Promise<
|
|||
}
|
||||
|
||||
try {
|
||||
const data = await headlessRenderNodes(
|
||||
graph,
|
||||
page.id,
|
||||
indices.map((index) => childIds[index]),
|
||||
{
|
||||
scale,
|
||||
format: 'PNG'
|
||||
}
|
||||
)
|
||||
const nodeIds = indices.map((index) => childIds[index])
|
||||
const data = await headlessRenderNodes(graph, page.id, nodeIds, {
|
||||
scale,
|
||||
format: 'PNG',
|
||||
trimTransparent: nodeIds.every((id) => graph.getNode(id)?.type === 'TEXT')
|
||||
})
|
||||
if (!data) throw new Error(`OpenPencil render produced no image for ${indices.join(',')}`)
|
||||
await Bun.write(path, data)
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in a new issue