mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 15:15:22 +03:00
fix thumbnails and annotation offset math
This commit is contained in:
parent
548fc2c30c
commit
281ddde15c
@ -119,9 +119,7 @@ export default function ObjectLifecycle({
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return config.cameras[event.camera]?.detect?.annotation_offset || 0;
|
||||||
(config.cameras[event.camera]?.detect?.annotation_offset || 0) / 1000
|
|
||||||
);
|
|
||||||
}, [config, event]);
|
}, [config, event]);
|
||||||
|
|
||||||
const [annotationOffset, setAnnotationOffset] = useState<number>(
|
const [annotationOffset, setAnnotationOffset] = useState<number>(
|
||||||
|
|||||||
@ -223,16 +223,16 @@ function EventItem({
|
|||||||
onMouseLeave={isDesktop ? () => setHovered(false) : undefined}
|
onMouseLeave={isDesktop ? () => setHovered(false) : undefined}
|
||||||
key={event.id}
|
key={event.id}
|
||||||
>
|
>
|
||||||
<div className="pointer-events-none absolute inset-x-0 top-0 h-[30%] w-full rounded-lg bg-gradient-to-b from-black/20 to-transparent md:rounded-2xl"></div>
|
{event.has_snapshot && (
|
||||||
<div className="pointer-events-none absolute inset-x-0 bottom-0 z-10 h-[10%] w-full rounded-lg bg-gradient-to-t from-black/20 to-transparent md:rounded-2xl"></div>
|
<>
|
||||||
|
<div className="pointer-events-none absolute inset-x-0 top-0 h-[30%] w-full rounded-lg bg-gradient-to-b from-black/20 to-transparent md:rounded-2xl"></div>
|
||||||
|
<div className="pointer-events-none absolute inset-x-0 bottom-0 z-10 h-[10%] w-full rounded-lg bg-gradient-to-t from-black/20 to-transparent md:rounded-2xl"></div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<img
|
<img
|
||||||
ref={imgRef}
|
ref={imgRef}
|
||||||
className={cn(
|
className={cn(
|
||||||
"aspect-video select-none rounded-lg object-contain transition-opacity",
|
"select-none rounded-lg object-contain transition-opacity",
|
||||||
event.has_snapshot &&
|
|
||||||
event.plus_id == undefined &&
|
|
||||||
config?.plus.enabled &&
|
|
||||||
"cursor-pointer",
|
|
||||||
)}
|
)}
|
||||||
style={
|
style={
|
||||||
isIOS
|
isIOS
|
||||||
@ -251,7 +251,13 @@ function EventItem({
|
|||||||
/>
|
/>
|
||||||
{hovered && (
|
{hovered && (
|
||||||
<div>
|
<div>
|
||||||
<div className="absolute right-1 top-1 flex items-center gap-2">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"absolute",
|
||||||
|
event.has_snapshot ? "right-1" : "left-1",
|
||||||
|
"top-1 flex items-center gap-2",
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<a
|
<a
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user