aboutsummaryrefslogtreecommitdiff
path: root/pages/editor.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'pages/editor.tsx')
-rw-r--r--pages/editor.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx
index e08d6ae..dc74699 100644
--- a/pages/editor.tsx
+++ b/pages/editor.tsx
@@ -345,7 +345,7 @@ function TimelineEditor(props: {
config: { mass: 0.5, tension: 500, friction: 20 },
}));
var selectionRef = useRef(null);
- useDrag(({ xy: [x, y], initial: [bx, by], last, movement: [ox, oy] }) => {
+ useDrag(({ xy: [x, y], initial: [bx, by], first, last, movement: [ox, oy] }) => {
if (props.selectedTool != 'cursor') return;
// var frame = Math.max(0, Math.round(getFrameAtOffset(x - 240, timelineZoom)) - 1);
var minDistance = 5; // minimal drag distance in pixels to register selection
@@ -373,7 +373,7 @@ function TimelineEditor(props: {
if (distanceTraveled <= minDistance) setSelectionHidden(true);
}
- selectionPosAPI.start({ x1, y1, x2, y2 });
+ selectionPosAPI[first && selectionHidden ? 'set' : 'start']({ x1, y1, x2, y2 });
}, { domTarget: selectionRef, eventOptions: { passive: false } });
return <>