Skip to content

🎥 Make videos programmatically with React

`remotion`: Default scale in a 0x0 container should be 1

Jonny Burgere68a54bece06
diff --git a/packages/core/src/use-current-scale.ts b/packages/core/src/use-current-scale.ts
index 61f64db847..a051c3c582 100644
--- a/packages/core/src/use-current-scale.ts
+++ b/packages/core/src/use-current-scale.ts
@@ -67,7 +67,16 @@ export const calculateScale = ({
const ratio = Math.min(heightRatio, widthRatio);
- return previewSize === 'auto' ? ratio : Number(previewSize);
+ if (previewSize === 'auto') {
+ // Container may be 0x0 because it doesn't have any content yet.
+ if (ratio === 0) {
+ return 1;
+ }
+
+ return ratio;
+ }
+
+ return Number(previewSize);
};
/*