From 53b31224c18a7941878a47c11126cb1d060a4de7 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:56:36 -0500 Subject: [PATCH] Use full resolution aspect for main camera style in history view --- web/src/views/events/RecordingView.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index f42e83a17..e0dcb65aa 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -314,7 +314,10 @@ export function RecordingView({ return undefined; } - const aspect = camera.detect.width / camera.detect.height; + const aspect = + fullResolution.width && fullResolution.height + ? fullResolution.width / fullResolution.height + : camera.detect.width / camera.detect.height; if (!aspect) { return undefined; @@ -336,7 +339,14 @@ export function RecordingView({ return { width: `${Math.round(percent)}%`, }; - }, [config, mainCameraAspect, mainWidth, mainHeight, mainCamera]); + }, [ + config, + mainCameraAspect, + mainWidth, + mainHeight, + mainCamera, + fullResolution, + ]); const previewRowOverflows = useMemo(() => { if (!previewRowRef.current) {