aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/Track.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/Track.tsx')
-rw-r--r--src/client/views/nodes/Track.tsx5
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() {