Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Use crop size to calculate padding

Richie McIlroy362d1cc11b65
diff --git a/apps/desktop/src/routes/screenshot-editor/context.tsx b/apps/desktop/src/routes/screenshot-editor/context.tsx
index ef71f40e8..635ef6788 100644
--- a/apps/desktop/src/routes/screenshot-editor/context.tsx
+++ b/apps/desktop/src/routes/screenshot-editor/context.tsx
@@ -409,8 +409,8 @@ function createScreenshotEditorContext() {
const outputAspect = frameSize.width / frameSize.height;
const paddingFactor = (padding / 100.0) * SCREEN_MAX_PADDING;
- const paddingPixels =
- Math.max(frameSize.width, frameSize.height) * paddingFactor;
+ const cropBasis = Math.max(cropWidth, cropHeight);
+ const paddingPixels = cropBasis * paddingFactor;
const availableWidth = frameSize.width - 2 * paddingPixels;
const availableHeight = frameSize.height - 2 * paddingPixels;