Skip to content

🎥 Make videos programmatically with React

`@remotion/paths`: Make sure path is fully hidden when progress === 0

Jonny Burger7c94a36f549d
diff --git a/packages/paths/src/evolve-path.ts b/packages/paths/src/evolve-path.ts
index 9209523c71..6da35fbb9a 100644
--- a/packages/paths/src/evolve-path.ts
+++ b/packages/paths/src/evolve-path.ts
@@ -8,6 +8,15 @@ import {getLength} from './get-length';
*/
export const evolvePath = (progress: number, path: string) => {
const length = getLength(path);
+
+ if (progress === 0) {
+ const extendedLength = length * 1.5;
+ return {
+ strokeDasharray: `${extendedLength} ${extendedLength}`,
+ strokeDashoffset: extendedLength,
+ };
+ }
+
const strokeDasharray = `${length} ${length}`;
const strokeDashoffset = length - progress * length;