Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fix frame aspect ratio calculation in PreviewCanvas

Richie McIlroya217649020b0
diff --git a/apps/desktop/src/routes/editor/Player.tsx b/apps/desktop/src/routes/editor/Player.tsx
index 877585140..9b0245d12 100644
--- a/apps/desktop/src/routes/editor/Player.tsx
+++ b/apps/desktop/src/routes/editor/Player.tsx
@@ -397,7 +397,12 @@ function PreviewCanvas() {
return width / height;
};
- const frameAspect = () => frameWidth() / frameHeight();
+ const frameAspect = () => {
+ const width = frameWidth();
+ const height = frameHeight();
+ if (width === 0 || height === 0) return containerAspect();
+ return width / height;
+ };
const size = () => {
let width: number;