chore(scripts): trim text-only bisect exports

This commit is contained in:
Danila Poyarkov 2026-05-18 13:36:03 +03:00
parent 51e961fc47
commit 977ccacf41

View file

@ -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 {