From 9bc67e9ab864768e6aca4b091aeb72350502f6b3 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Fri, 15 Dec 2023 13:22:51 -0700 Subject: [PATCH] Cleanup --- web-new/src/components/camera/CameraImage.tsx | 13 ++++++++++--- web-new/src/pages/Dashboard.tsx | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web-new/src/components/camera/CameraImage.tsx b/web-new/src/components/camera/CameraImage.tsx index 6d38c488a..853c2da09 100644 --- a/web-new/src/components/camera/CameraImage.tsx +++ b/web-new/src/components/camera/CameraImage.tsx @@ -45,9 +45,11 @@ export default function CameraImage({ const aspectRatio = width / height; const scaledHeight = useMemo(() => { - const scaledHeight = (aspectRatio < (fitAspect ?? 0)) ? Math.floor(containerHeight) : Math.floor(availableWidth / aspectRatio); + const scaledHeight = + aspectRatio < (fitAspect ?? 0) + ? Math.floor(containerHeight) + : Math.floor(availableWidth / aspectRatio); const finalHeight = stretch ? scaledHeight : Math.min(scaledHeight, height); - console.log("returning " + containerHeight + " for " + camera) if (finalHeight > 0) { return finalHeight; @@ -83,7 +85,12 @@ export default function CameraImage({ }, [apiHost, canvasRef, name, img, searchParams, scaledHeight, config]); return ( -
+
{enabled ? (