mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-23 12:06:14 +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
|
// PDF bounds validation if provided
|
||||||
if (pdfBounds) {
|
if (pdfBounds) {
|
||||||
return cropArea.x + cropArea.width <= pdfBounds.actualWidth &&
|
const tolerance = 0.01; // Small tolerance for floating point precision
|
||||||
cropArea.y + cropArea.height <= pdfBounds.actualHeight;
|
return cropArea.x + cropArea.width <= pdfBounds.actualWidth + tolerance &&
|
||||||
|
cropArea.y + cropArea.height <= pdfBounds.actualHeight + tolerance;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user