From bad60077d44e468e8453bd0e2b484f87bca9efae Mon Sep 17 00:00:00 2001 From: amhsirak Date: Tue, 4 Mar 2025 22:40:26 +0530 Subject: [PATCH] feat: update canvas size --- src/components/recorder/Renderer.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/recorder/Renderer.tsx b/src/components/recorder/Renderer.tsx index 1d778d5b..e042595b 100644 --- a/src/components/recorder/Renderer.tsx +++ b/src/components/recorder/Renderer.tsx @@ -197,5 +197,25 @@ export class CanvasRenderer { } } - + /** + * Update canvas dimensions + */ + public updateCanvasSize(width: number, height: number): void { + this.canvas.width = width; + this.canvas.height = height; + + // Re-apply context settings + this.ctx.imageSmoothingEnabled = false; + + // Update offscreen canvas if available + if (this.offscreenCanvas) { + this.offscreenCanvas.width = width; + this.offscreenCanvas.height = height; + + if (this.offscreenCtx) { + this.offscreenCtx.imageSmoothingEnabled = false; + } + } + } + } \ No newline at end of file