From 782e0f621e03fb6273859c932582226f312343e5 Mon Sep 17 00:00:00 2001 From: Cole Lawrence Date: Mon, 30 May 2022 08:49:08 -0400 Subject: [PATCH] doc: Why useLockFrameStampPosition in useDragForSingleKeyframeDot Co-authored-by: Andrew Prifer <2991360+AndrewPrifer@users.noreply.github.com> --- .../BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.tsx index d3e5a62..ccd15f7 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.tsx @@ -245,6 +245,9 @@ function useDragForSingleKeyframeDot( const [isDragging] = useDrag(node, useDragOpts) + // Lock frame stamp to the current position of the dragged keyframe instead of + // the mouse position, so that it appears centered above the keyframe even + // regardless of where in the hit zone of the keyframe the mouse is located. useLockFrameStampPosition(isDragging, props.keyframe.position) useCssCursorLock(isDragging, 'draggingPositionInSequenceEditor', 'ew-resize')