diff options
author | andrewdkim <adkim414@gmail.com> | 2019-06-20 11:48:45 -0400 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-06-20 11:48:45 -0400 |
commit | 82f21b627c4823b1984cd1865aea6eb91f290eca (patch) | |
tree | da5494f35f94075e594b054d20daa68b82c17916 /src/client/views/nodes/Track.tsx | |
parent | b856d4c0be0b08bf154d552226457b82d31cf81c (diff) |
drag change
Diffstat (limited to 'src/client/views/nodes/Track.tsx')
-rw-r--r-- | src/client/views/nodes/Track.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/nodes/Track.tsx b/src/client/views/nodes/Track.tsx index cfb30aac5..dab73ce06 100644 --- a/src/client/views/nodes/Track.tsx +++ b/src/client/views/nodes/Track.tsx @@ -398,7 +398,10 @@ export class Track extends React.Component<props> { @action onInnerDoubleClick = (e: React.MouseEvent) => { - this._keyframes.push(<Keyframe position={200} />); + let inner = this._inner.current!; + let left = inner.getBoundingClientRect().left; + let offsetX = Math.round(e.clientX - left); + this._keyframes.push(<Keyframe position={offsetX} />); } render() { |