mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 05:05:26 +03:00
don't set aspect ratio on fullscreen
This commit is contained in:
parent
f4b7c81909
commit
90c7273f6a
@ -117,9 +117,9 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
|||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
if (aspect > 16 / 9) {
|
if (aspect > 16 / 9) {
|
||||||
return "absolute inset-x-0 top-[50%] -translate-y-[50%]";
|
return "absolute inset-x-2 top-[50%] -translate-y-[50%]";
|
||||||
} else {
|
} else {
|
||||||
return "absolute inset-y-0 left-[50%] -translate-x-[50%]";
|
return "absolute inset-y-2 left-[50%] -translate-x-[50%]";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "absolute top-2 bottom-2 left-[50%] -translate-x-[50%]";
|
return "absolute top-2 bottom-2 left-[50%] -translate-x-[50%]";
|
||||||
@ -135,14 +135,14 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
|||||||
}, [camera]);
|
}, [camera]);
|
||||||
|
|
||||||
const aspectRatio = useMemo<number>(() => {
|
const aspectRatio = useMemo<number>(() => {
|
||||||
if (isMobile) {
|
if (isMobile || fullscreen) {
|
||||||
return cameraAspectRatio;
|
return cameraAspectRatio;
|
||||||
} else {
|
} else {
|
||||||
return windowAspectRatio < cameraAspectRatio
|
return windowAspectRatio < cameraAspectRatio
|
||||||
? windowAspectRatio - 0.05
|
? windowAspectRatio - 0.05
|
||||||
: cameraAspectRatio - 0.03;
|
: cameraAspectRatio - 0.03;
|
||||||
}
|
}
|
||||||
}, [cameraAspectRatio, windowAspectRatio]);
|
}, [cameraAspectRatio, windowAspectRatio, fullscreen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user