mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-26 17:52:59 +02: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…
Reference in New Issue
Block a user