fix: feedback coderabbit

This commit is contained in:
Garry Laly
2026-04-05 20:19:31 +07:00
parent 79201569c5
commit 2ee7ccd89c
+2 -1
View File
@@ -60,7 +60,8 @@ export interface WebcamCompositeLayout {
/** Convert a webcam size percentage (1050) 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;
}