mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-06 23:27:36 +03:00
Fix: revert cameraAspectRatio inversion for ui.rotate cameras
The previous commit caused a double dimension swap for rotated cameras: - LiveCameraView was inverting the aspect ratio (1/ratio) → portrait container - MsePlayer was then swapping width/height again internally when isRotatedGrid=true → video got zero/invalid dimensions, nothing visible The MsePlayer already handles the full rotation internally via CSS variables (transform + width/height swap). The container in LiveCameraView should keep the original (landscape) aspect ratio, matching the grid cell behavior in DraggableGridLayout where this works correctly. https://claude.ai/code/session_01CDLHQPGpf8w44jpsG8g8nM
This commit is contained in:
parent
ea9ca2f8d1
commit
54b3717a60
@ -360,13 +360,11 @@ export default function LiveCameraView({
|
|||||||
}, [windowAspectRatio, containerRef]);
|
}, [windowAspectRatio, containerRef]);
|
||||||
|
|
||||||
const cameraAspectRatio = useMemo(() => {
|
const cameraAspectRatio = useMemo(() => {
|
||||||
let ratio;
|
|
||||||
if (fullResolution.width && fullResolution.height) {
|
if (fullResolution.width && fullResolution.height) {
|
||||||
ratio = fullResolution.width / fullResolution.height;
|
return fullResolution.width / fullResolution.height;
|
||||||
} else {
|
} else {
|
||||||
ratio = camera.detect.width / camera.detect.height;
|
return camera.detect.width / camera.detect.height;
|
||||||
}
|
}
|
||||||
return camera.ui?.rotate ? 1 / ratio : ratio;
|
|
||||||
}, [camera, fullResolution]);
|
}, [camera, fullResolution]);
|
||||||
|
|
||||||
const constrainedAspectRatio = useMemo<number>(() => {
|
const constrainedAspectRatio = useMemo<number>(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user