NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
fix draggable element pixel alignment (#10708)
Josh Hawkins98a1e6ee2229
diff --git a/web/src/components/timeline/ReviewTimeline.tsx b/web/src/components/timeline/ReviewTimeline.tsxindex 8d6b594718..35dcd6c8c9 100644--- a/web/src/components/timeline/ReviewTimeline.tsx+++ b/web/src/components/timeline/ReviewTimeline.tsx@@ -259,7 +259,7 @@ export function ReviewTimeline({></div></div><div- className={`absolute h-1 w-full bg-destructive ${isDragging && isMobile && draggableElementType == "handlebar" ? "top-1" : "top-1/2 transform -translate-y-1/2"}`}+ className={`absolute h-[4px] w-full bg-destructive ${isDragging && isMobile && draggableElementType == "handlebar" ? "top-1" : "top-1/2 transform -translate-y-1/2"}`}></div></div></div>@@ -293,7 +293,7 @@ export function ReviewTimeline({></div></div><div- className={`absolute h-1 w-full bg-selected ${isDragging && isMobile && draggableElementType == "export_end" ? "top-0" : "top-1/2 transform -translate-y-1/2"}`}+ className={`absolute h-[4px] w-full bg-selected ${isDragging && isMobile && draggableElementType == "export_end" ? "top-0" : "top-1/2 transform -translate-y-1/2"}`}></div></div></div>@@ -318,7 +318,7 @@ export function ReviewTimeline({}`}><div- className={`absolute h-1 w-full bg-selected ${isDragging && isMobile && draggableElementType == "export_start" ? "top-[12px]" : "top-1/2 transform -translate-y-1/2"}`}+ className={`absolute h-[4px] w-full bg-selected ${isDragging && isMobile && draggableElementType == "export_start" ? "top-[12px]" : "top-1/2 transform -translate-y-1/2"}`}></div><divclassName={`bg-selected mt-4 mx-auto ${diff --git a/web/src/hooks/use-draggable-element.ts b/web/src/hooks/use-draggable-element.tsindex eb32ce2bb0..24b143e938 100644--- a/web/src/hooks/use-draggable-element.ts+++ b/web/src/hooks/use-draggable-element.ts@@ -382,12 +382,12 @@ function useDraggableElement({const timelineRect = timelineRef.current.getBoundingClientRect();const timelineTopAbsolute = timelineRect.top;const rect = segmentElement.getBoundingClientRect();- const segmentTop =- rect.top + scrolled - timelineTopAbsolute - segmentHeight / 2;+ const segmentTop = rect.top + scrolled - timelineTopAbsolute;const offset =((draggableElementTime - alignedSegmentTime) / segmentDuration) *segmentHeight;- const newElementPosition = segmentTop - offset;+ // subtract half the height of the handlebar cross bar (4px) for pixel perfection+ const newElementPosition = segmentTop - offset - 2;updateDraggableElementPosition(newElementPosition,