🚀 Auto-deploy: BrainWind atualizado em 13/07/2026 18:29:33

This commit is contained in:
2026-07-13 18:29:33 +00:00
parent 8b515847f8
commit 231ec09a76
2 changed files with 8 additions and 3 deletions
+1
View File
@@ -41,6 +41,7 @@ function CanvasInner({ fallback: _, shadows, ...canvasProps }: SceneCanvasProps)
return (
<Canvas
frameloop="demand"
gl={{ preserveDrawingBuffer: true }}
{...canvasProps}
shadows={shadowConfig}
onCreated={(state) => {
+7 -3
View File
@@ -73,9 +73,8 @@ export async function captureCanvasImage(
outW = Math.round((outH / srcH) * srcW);
}
if (outW === srcW && outH === srcH) {
return canvasToDataURL(canvas, format, quality);
}
// Removido o short-circuit (outW === srcW) para forçar a passagem pelo canvas 2D
// e garantir que o fundo transparente seja preenchido de branco.
const off = document.createElement('canvas');
off.width = outW;
@@ -85,6 +84,11 @@ export async function captureCanvasImage(
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = 'high';
// Preencher fundo com branco para evitar preto em áreas transparentes (especialmente em JPEGs ou PDFs)
ctx.fillStyle = '#ffffff';
ctx.fillRect(0, 0, outW, outH);
ctx.drawImage(canvas, 0, 0, outW, outH);
return off.toDataURL(`image/${format}`, quality);