Skip to content

🎥 Make videos programmatically with React

Update packages/convert/app/components/make-crop.tsx

Jonny Burgerd48bc631276d
diff --git a/packages/convert/app/components/make-crop.tsx b/packages/convert/app/components/make-crop.tsx
index b7e7a02093..8eeff1e664 100644
--- a/packages/convert/app/components/make-crop.tsx
+++ b/packages/convert/app/components/make-crop.tsx
@@ -18,15 +18,19 @@ export const makeCrop = ({
: dimensions!.height - cropRect.top;
// Round down to nearest even number if codec is avc or hevc
+ let left = cropRect.left;
+ let top = cropRect.top;
if (videoCodec === 'avc' || videoCodec === 'hevc') {
width = Math.floor(width / 2) * 2;
height = Math.floor(height / 2) * 2;
+ left = Math.floor(left / 2) * 2;
+ top = Math.floor(top / 2) * 2;
}
return {
width,
height,
- left: cropRect.left,
- top: cropRect.top,
+ left,
+ top,
};
};