fix: Crop box broken
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 3m22s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 22s
Deploy to Staging / Verify Staging (pull_request) Successful in 8s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped

This commit is contained in:
Eric Gullickson
2026-02-07 16:00:23 -06:00
parent dab4a3bdf3
commit 0499c902a8

View File

@@ -318,17 +318,15 @@ export function useImageCrop(options: UseImageCropOptions = {}): UseImageCropRet
if (isDrawingRef.current) {
isDrawingRef.current = false;
const area = cropAreaRef.current;
// When aspect ratio constrains one dimension, only check the free dimension
const meetsMinSize = aspectRatio
? area.width >= minSize
: area.width >= minSize && area.height >= minSize;
// Accept crop if at least one dimension is meaningful (allows thin strips like VINs)
const meetsMinSize = area.width >= minSize || area.height >= minSize;
if (meetsMinSize) {
setCropDrawn(true);
}
}
activeHandleRef.current = null;
setIsDragging(false);
}, [minSize, aspectRatio]);
}, [minSize]);
// Add global event listeners for drag
useEffect(() => {