mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix zoom scaling for live view (#10479)
This commit is contained in:
parent
f5a26c5962
commit
df0291db5c
@ -157,6 +157,7 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
}, [cameraAspectRatio, windowAspectRatio, fullscreen]);
|
||||
|
||||
return (
|
||||
<TransformWrapper minScale={1.0}>
|
||||
<div
|
||||
ref={mainRef}
|
||||
className={
|
||||
@ -242,7 +243,9 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
Icon={snapshotState == "ON" ? MdPhotoCamera : MdNoPhotography}
|
||||
isActive={snapshotState == "ON"}
|
||||
title={`${snapshotState == "ON" ? "Disable" : "Enable"} Snapshots`}
|
||||
onClick={() => sendSnapshot(snapshotState == "ON" ? "OFF" : "ON")}
|
||||
onClick={() =>
|
||||
sendSnapshot(snapshotState == "ON" ? "OFF" : "ON")
|
||||
}
|
||||
/>
|
||||
{camera.audio.enabled_in_config && (
|
||||
<CameraFeatureToggle
|
||||
@ -257,15 +260,24 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
<div className="relative size-full p-2">
|
||||
<TransformComponent
|
||||
wrapperStyle={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}}
|
||||
contentStyle={{
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "8px",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={growClassName}
|
||||
className={`flex flex-col justify-center items-center ${growClassName}`}
|
||||
style={{
|
||||
aspectRatio: aspectRatio,
|
||||
}}
|
||||
>
|
||||
<TransformWrapper minScale={1.0}>
|
||||
<TransformComponent>
|
||||
<LivePlayer
|
||||
key={camera.name}
|
||||
className={`m-1 ${fullscreen ? "*:rounded-none" : ""}`}
|
||||
@ -276,12 +288,11 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) {
|
||||
micEnabled={mic}
|
||||
preferredLiveMode={preferredLiveMode}
|
||||
/>
|
||||
</TransformComponent>
|
||||
</TransformWrapper>
|
||||
</div>
|
||||
{camera.onvif.host != "" && <PtzControlPanel camera={camera.name} />}
|
||||
</TransformComponent>
|
||||
</div>
|
||||
</div>
|
||||
</TransformWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user