always use full resolution time when dragging (#10939)

This commit is contained in:
Josh Hawkins 2024-04-11 08:29:34 -05:00 committed by GitHub
parent fb6f415b27
commit 7a7ae81d50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View File

@ -107,6 +107,7 @@ export function ReviewTimeline({
showDraggableElement: showHandlebar,
draggableElementTime: handlebarTime,
setDraggableElementTime: setHandlebarTime,
alignSetTimeToSegment: true,
initialScrollIntoViewOnly: onlyInitialHandlebarScroll,
timelineDuration,
timelineCollapsed: timelineCollapsed,

View File

@ -323,21 +323,21 @@ function useDraggableElement({
}
}
const setTime = alignSetTimeToSegment
? targetSegmentId
: targetSegmentId + segmentDuration * (offset / segmentHeight);
updateDraggableElementPosition(
newElementPosition,
targetSegmentId,
setTime,
false,
false,
);
if (setDraggableElementTime) {
if (alignSetTimeToSegment) {
setDraggableElementTime(targetSegmentId);
} else {
setDraggableElementTime(
targetSegmentId + segmentDuration * (offset / segmentHeight),
);
}
setDraggableElementTime(
targetSegmentId + segmentDuration * (offset / segmentHeight),
);
}
if (draggingAtTopEdge || draggingAtBottomEdge) {