mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +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]);
|
}, [config, selectedCamera]);
|
||||||
|
|
||||||
const stretch = true;
|
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(() => {
|
const scaledHeight = useMemo(() => {
|
||||||
if (containerRef.current && aspectRatio && detectHeight) {
|
if (containerRef.current && aspectRatio && detectHeight) {
|
||||||
|
Loading…
Reference in New Issue
Block a user