fixed cut

This commit is contained in:
2025-09-08 14:01:17 +02:00
parent c1a396f246
commit 3aa2504f3c
3 changed files with 12 additions and 6 deletions
+8 -2
View File
@@ -700,8 +700,14 @@ document.addEventListener("DOMContentLoaded", function () {
const img = croppedImage;
const cropX = (cropRect.left - img.left) / img.scaleX;
const cropY = (cropRect.top - img.top) / img.scaleY;
const cropWidth = cropRect.width / img.scaleX;
const cropHeight = cropRect.height / img.scaleY;
const cropWidth = (cropRect.width * cropRect.scaleX) / img.scaleX;
const cropHeight = (cropRect.height * cropRect.scaleY) / img.scaleY;
console.log("Parametri di ritaglio:", {
cropX,
cropY,
cropWidth,
cropHeight,
});
// Crea un'immagine ritagliata
fabric.Image.fromURL(