summaryrefslogtreecommitdiff
path: root/tools/timeline_editor/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'tools/timeline_editor/index.html')
-rw-r--r--tools/timeline_editor/index.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/timeline_editor/index.html b/tools/timeline_editor/index.html
index f5277d8..c6c54bd 100644
--- a/tools/timeline_editor/index.html
+++ b/tools/timeline_editor/index.html
@@ -784,10 +784,11 @@
isDragging = true;
// Calculate offset from timeline origin (not from element edge)
+ // CRITICAL: Use currentTarget (element with listener) not target (what was clicked)
const timelineRect = timeline.getBoundingClientRect();
- const currentLeft = parseFloat(e.target.style.left) || 0;
+ const currentLeft = parseFloat(e.currentTarget.style.left) || 0;
dragOffset.x = e.clientX - timelineRect.left - currentLeft;
- dragOffset.y = e.clientY - e.target.getBoundingClientRect().top;
+ dragOffset.y = e.clientY - e.currentTarget.getBoundingClientRect().top;
selectedItem = { type, index: seqIndex, seqIndex, effectIndex };
renderTimeline();
@@ -870,7 +871,9 @@
if (handleType === 'left') {
// Adjust start time, keep end time fixed
- effect.startTime = Math.max(0, Math.min(Math.round(relativeTime * 100) / 100, effect.endTime - 0.1));
+ // Allow negative times (effect can extend before sequence start)
+ const newStartTime = Math.round(relativeTime * 100) / 100;
+ effect.startTime = Math.min(newStartTime, effect.endTime - 0.1);
} else if (handleType === 'right') {
// Adjust end time, keep start time fixed
effect.endTime = Math.max(effect.startTime + 0.1, Math.round(relativeTime * 100) / 100);