Add tolerance to validation

This commit is contained in:
James Brunton 2025-09-19 16:16:32 +01:00
parent 0bd7e779ee
commit fa0d2b32d9

View File

@ -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;