Extend final shot to chunk boundary
This commit is contained in:
@@ -55,6 +55,13 @@ function configure(node) {
|
||||
};
|
||||
const addSlot = (clip, afterIndex = clip.slots.length - 1) => {
|
||||
const duration = Number(clip.duration) || 0.1;
|
||||
if (afterIndex === clip.slots.length - 1 && afterIndex >= 0) {
|
||||
const previous = clip.slots[afterIndex];
|
||||
const split = Number(previous.start) + Math.max(0.1, (duration - Number(previous.start)) / 2);
|
||||
previous.end = Math.min(duration - 0.1, split);
|
||||
clip.slots.splice(afterIndex + 1, 0, { start: previous.end, end: duration, text: "" });
|
||||
return;
|
||||
}
|
||||
const previousEnd = afterIndex >= 0 ? Number(clip.slots[afterIndex]?.end) || 0 : 0;
|
||||
const remaining = Math.max(0.1, duration - previousEnd);
|
||||
clip.slots.splice(afterIndex + 1, 0, {
|
||||
@@ -86,6 +93,7 @@ function configure(node) {
|
||||
// All clips share the one authoritative project duration widget.
|
||||
const duration = chunkDuration;
|
||||
clip.duration = duration;
|
||||
if (clip.slots.length) clip.slots[clip.slots.length - 1].end = duration;
|
||||
const durationRow = el("div"); durationRow.style.cssText = "display:flex;align-items:center;gap:8px;margin:4px 0;color:#b7d6bf";
|
||||
durationRow.append(el("strong", `Clip ${active + 1}`), el("span", `· ${duration.toFixed(1)}s shared chunk duration`)); panel.append(durationRow);
|
||||
const timeline = el("div"); timeline.style.cssText = "position:relative;height:44px;margin:8px 0 3px;background:#15251a;border-radius:3px;overflow:hidden;border:1px solid #41634a";
|
||||
|
||||
Reference in New Issue
Block a user