1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-11 02:10:11 +01:00

Merge pull request #1354 from foivospro/main

Fix Error When Submitting Crop Tool Without Making a Selection
This commit is contained in:
Anthony Stirling 2024-06-01 12:02:18 +01:00 committed by GitHub
commit fcd4af2d09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,6 +75,16 @@
} }
}); });
cropForm.addEventListener('submit', function(e) {
if (xInput.value == "" && yInput.value == "" && widthInput.value == "" && heightInput.value == "") {
// Ορίστε συντεταγμένες για ολόκληρη την επιφάνεια του PDF
xInput.value = 0;
yInput.value = 0;
widthInput.value = pdfCanvas.width;
heightInput.value = pdfCanvas.height;
}
});
overlayCanvas.addEventListener('mousedown', function(e) { overlayCanvas.addEventListener('mousedown', function(e) {
// Clear previously drawn rectangle on the main canvas // Clear previously drawn rectangle on the main canvas
context.clearRect(0, 0, pdfCanvas.width, pdfCanvas.height); context.clearRect(0, 0, pdfCanvas.width, pdfCanvas.height);