Skip to content

🎥 Make videos programmatically with React

Hide premounted frame labels when premounting is hidden

Jonny Burger13f1b733f6a1
diff --git a/packages/studio/src/components/Timeline/TimelineSequence.tsx b/packages/studio/src/components/Timeline/TimelineSequence.tsx
index 4037c3278b..a681c85d56 100644
--- a/packages/studio/src/components/Timeline/TimelineSequence.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequence.tsx
@@ -328,6 +328,7 @@ const TimelineSequenceBar: React.FC<{
readonly width: number;
} | null;
readonly premount: {readonly left: number; readonly width: number} | null;
+ readonly showPremounting: boolean;
readonly postmount: {readonly left: number; readonly width: number} | null;
readonly negativeStart: {
readonly left: number;
@@ -362,6 +363,7 @@ const TimelineSequenceBar: React.FC<{
displayDurationInFrames,
selectionBounds,
premount,
+ showPremounting,
postmount,
negativeStart,
leftEdgeVisible,
@@ -549,6 +551,7 @@ const TimelineSequenceBar: React.FC<{
displayDurationInFrames={displayDurationInFrames}
paddingLeft={5 + negativeStartEnd + (premount?.width ?? 0)}
frozenFrame={frozenFrame}
+ showPremounting={showPremounting}
/>
) : null}
@@ -1738,6 +1741,7 @@ const TimelineSequenceInner: React.FC<{
displayDurationInFrames={displayDurationInFrames}
selectionBounds={visibleLayout.media}
premount={visibleLayout.premount}
+ showPremounting={showPremounting}
postmount={visibleLayout.postmount}
negativeStart={visibleLayout.negativeStart}
leftEdgeVisible={visibleLayout.leftEdgeVisible}
diff --git a/packages/studio/src/components/Timeline/TimelineSequenceFrame.tsx b/packages/studio/src/components/Timeline/TimelineSequenceFrame.tsx
index 71fde573f6..2cd3808514 100644
--- a/packages/studio/src/components/Timeline/TimelineSequenceFrame.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequenceFrame.tsx
@@ -30,12 +30,14 @@ export const TimelineSequenceFrame: React.FC<{
readonly displayDurationInFrames: number;
readonly paddingLeft: number;
readonly frozenFrame: number | null;
+ readonly showPremounting: boolean;
}> = ({
s,
sequenceFrameOffset,
displayDurationInFrames,
paddingLeft,
frozenFrame,
+ showPremounting,
}) => {
const frame = useCurrentFrame();
const relativeFrame = frame - s.from;
@@ -46,6 +48,7 @@ export const TimelineSequenceFrame: React.FC<{
relativeFrame >= 0 && relativeFrame < displayDurationInFrames;
const relativeFrameWithPremount = relativeFrame + (s.premountDisplay ?? 0);
const isPremounting =
+ showPremounting &&
relativeFrameWithPremount >= 0 &&
relativeFrameWithPremount < displayDurationInFrames &&
!isInRange;