From 2ee7ccd89cad8fe1094642bc2318959a66d23621 Mon Sep 17 00:00:00 2001 From: Garry Laly Date: Sun, 5 Apr 2026 20:19:31 +0700 Subject: [PATCH] fix: feedback coderabbit --- src/lib/compositeLayout.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/compositeLayout.ts b/src/lib/compositeLayout.ts index b51b9ff..48583a3 100644 --- a/src/lib/compositeLayout.ts +++ b/src/lib/compositeLayout.ts @@ -60,7 +60,8 @@ export interface WebcamCompositeLayout { /** Convert a webcam size percentage (10–50) to a fraction of the reference dimension. */ function webcamSizeToFraction(percent: number): number { - const clamped = Math.max(10, Math.min(50, percent)); + const safe = Number.isFinite(percent) ? percent : 25; + const clamped = Math.max(10, Math.min(50, safe)); return clamped / 100; }