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