diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx index 6eb06ae..d561d0e 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Connector.tsx @@ -181,6 +181,7 @@ function useDragKeyframe(node: HTMLDivElement | null, props: IProps) { pathToProp: leaf.pathToProp, trackId: leaf.trackId, keyframeId: props.keyframe.id, + domNode: node!, positionAtStartOfDrag: props.trackData.keyframes[props.index].position, }) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx index e08e074..df1b027 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx @@ -164,6 +164,7 @@ function useDragKeyframe( pathToProp: leaf.pathToProp, trackId: leaf.trackId, keyframeId: props.keyframe.id, + domNode: node!, positionAtStartOfDrag: props.trackData.keyframes[props.index].position, }) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx index 52925c8..cf7d475 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.tsx @@ -212,12 +212,14 @@ namespace utils { tempTransaction = undefined } - const snapTarget = event.composedPath().find( - (el): el is Element => - el instanceof Element && - // el !== node && - el.hasAttribute('data-pos'), - ) + const snapTarget = event + .composedPath() + .find( + (el): el is Element => + el instanceof Element && + el !== origin.domNode && + el.hasAttribute('data-pos'), + ) if (snapTarget) { const snapPos = parseFloat(snapTarget.getAttribute('data-pos')!) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/layout/layout.ts b/theatre/studio/src/panels/SequenceEditorPanel/layout/layout.ts index 45c347d..be43bb7 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/layout/layout.ts +++ b/theatre/studio/src/panels/SequenceEditorPanel/layout/layout.ts @@ -56,6 +56,7 @@ export type DopeSheetSelection = { trackId: string keyframeId: string positionAtStartOfDrag: number + domNode: Element }, ): Parameters[1] delete(): void