mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
calculate aspect ratio of container to prevent overflow (#11495)
This commit is contained in:
parent
4d05bc25f4
commit
058e9a3ba0
@ -98,8 +98,11 @@ export default function MasksAndZones({
|
||||
}, [config, selectedCamera]);
|
||||
|
||||
const stretch = true;
|
||||
// may need tweaking for mobile
|
||||
const fitAspect = isDesktop ? 16 / 9 : 3 / 4;
|
||||
|
||||
const fitAspect = useMemo(
|
||||
() => (isDesktop ? containerWidth / containerHeight : 3 / 4),
|
||||
[containerWidth, containerHeight],
|
||||
);
|
||||
|
||||
const scaledHeight = useMemo(() => {
|
||||
if (containerRef.current && aspectRatio && detectHeight) {
|
||||
|
Loading…
Reference in New Issue
Block a user