From c010b55eaab5b27a4fec6b8aeee933695454f3a2 Mon Sep 17 00:00:00 2001 From: Siddharth Date: Tue, 16 Dec 2025 13:52:53 -0700 Subject: [PATCH] fix:Border radius appears smaller in export compared to preview --- src/lib/exporter/frameRenderer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts index 92bbf67a..d0ba1d93 100644 --- a/src/lib/exporter/frameRenderer.ts +++ b/src/lib/exporter/frameRenderer.ts @@ -365,9 +365,14 @@ export class FrameRenderer { this.videoContainer.x = centerOffsetX; this.videoContainer.y = centerOffsetY; - // Update mask + // scale border radius by export/preview canvas ratio + const previewWidth = this.config.previewWidth || 1920; + const previewHeight = this.config.previewHeight || 1080; + const canvasScaleFactor = Math.min(width / previewWidth, height / previewHeight); + const scaledBorderRadius = borderRadius * canvasScaleFactor; + this.maskGraphics.clear(); - this.maskGraphics.roundRect(0, 0, croppedDisplayWidth, croppedDisplayHeight, borderRadius); + this.maskGraphics.roundRect(0, 0, croppedDisplayWidth, croppedDisplayHeight, scaledBorderRadius); this.maskGraphics.fill({ color: 0xffffff }); // Cache layout info