From fa0d2b32d9654e2b7fa07c059f8e8a04afa8c2c0 Mon Sep 17 00:00:00 2001 From: James Brunton Date: Fri, 19 Sep 2025 16:16:32 +0100 Subject: [PATCH] Add tolerance to validation --- frontend/src/hooks/tools/crop/useCropParameters.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/tools/crop/useCropParameters.ts b/frontend/src/hooks/tools/crop/useCropParameters.ts index 871818f90..2c2f7145a 100644 --- a/frontend/src/hooks/tools/crop/useCropParameters.ts +++ b/frontend/src/hooks/tools/crop/useCropParameters.ts @@ -91,8 +91,9 @@ export const useCropParameters = (): CropParametersHook => { // PDF bounds validation if provided if (pdfBounds) { - return cropArea.x + cropArea.width <= pdfBounds.actualWidth && - cropArea.y + cropArea.height <= pdfBounds.actualHeight; + const tolerance = 0.01; // Small tolerance for floating point precision + return cropArea.x + cropArea.width <= pdfBounds.actualWidth + tolerance && + cropArea.y + cropArea.height <= pdfBounds.actualHeight + tolerance; } return true;