Bug fix
This commit is contained in:
parent
4eaba1e8d5
commit
af336a0a82
4 changed files with 11 additions and 6 deletions
|
@ -181,6 +181,7 @@ function useDragKeyframe(node: HTMLDivElement | null, props: IProps) {
|
||||||
pathToProp: leaf.pathToProp,
|
pathToProp: leaf.pathToProp,
|
||||||
trackId: leaf.trackId,
|
trackId: leaf.trackId,
|
||||||
keyframeId: props.keyframe.id,
|
keyframeId: props.keyframe.id,
|
||||||
|
domNode: node!,
|
||||||
positionAtStartOfDrag:
|
positionAtStartOfDrag:
|
||||||
props.trackData.keyframes[props.index].position,
|
props.trackData.keyframes[props.index].position,
|
||||||
})
|
})
|
||||||
|
|
|
@ -164,6 +164,7 @@ function useDragKeyframe(
|
||||||
pathToProp: leaf.pathToProp,
|
pathToProp: leaf.pathToProp,
|
||||||
trackId: leaf.trackId,
|
trackId: leaf.trackId,
|
||||||
keyframeId: props.keyframe.id,
|
keyframeId: props.keyframe.id,
|
||||||
|
domNode: node!,
|
||||||
positionAtStartOfDrag:
|
positionAtStartOfDrag:
|
||||||
props.trackData.keyframes[props.index].position,
|
props.trackData.keyframes[props.index].position,
|
||||||
})
|
})
|
||||||
|
|
|
@ -212,12 +212,14 @@ namespace utils {
|
||||||
tempTransaction = undefined
|
tempTransaction = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const snapTarget = event.composedPath().find(
|
const snapTarget = event
|
||||||
(el): el is Element =>
|
.composedPath()
|
||||||
el instanceof Element &&
|
.find(
|
||||||
// el !== node &&
|
(el): el is Element =>
|
||||||
el.hasAttribute('data-pos'),
|
el instanceof Element &&
|
||||||
)
|
el !== origin.domNode &&
|
||||||
|
el.hasAttribute('data-pos'),
|
||||||
|
)
|
||||||
|
|
||||||
if (snapTarget) {
|
if (snapTarget) {
|
||||||
const snapPos = parseFloat(snapTarget.getAttribute('data-pos')!)
|
const snapPos = parseFloat(snapTarget.getAttribute('data-pos')!)
|
||||||
|
|
|
@ -56,6 +56,7 @@ export type DopeSheetSelection = {
|
||||||
trackId: string
|
trackId: string
|
||||||
keyframeId: string
|
keyframeId: string
|
||||||
positionAtStartOfDrag: number
|
positionAtStartOfDrag: number
|
||||||
|
domNode: Element
|
||||||
},
|
},
|
||||||
): Parameters<typeof useDrag>[1]
|
): Parameters<typeof useDrag>[1]
|
||||||
delete(): void
|
delete(): void
|
||||||
|
|
Loading…
Reference in a new issue