mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-22 19:46:39 +00:00
Add tolerance to validation
This commit is contained in:
parent
0bd7e779ee
commit
fa0d2b32d9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user