diff --git a/src/lib/components/wizard/StepGallery.svelte b/src/lib/components/wizard/StepGallery.svelte index ec8f673..ad55ced 100644 --- a/src/lib/components/wizard/StepGallery.svelte +++ b/src/lib/components/wizard/StepGallery.svelte @@ -245,12 +245,12 @@ centerX = Math.max(cropWidth/2, Math.min(centerX, img.naturalWidth - cropWidth/2)); centerY = Math.max(cropHeight/2, Math.min(centerY, img.naturalHeight - cropHeight/2)); - const cropX = Math.round(centerX - cropWidth/2); - const cropY = Math.round(centerY - cropHeight/2); + const cropX = centerX - cropWidth/2; + const cropY = centerY - cropHeight/2; const crop = { - x: Math.max(0, cropX), - y: Math.max(0, cropY), + x: Math.round(Math.max(0, cropX)), + y: Math.round(Math.max(0, cropY)), width: Math.round(cropWidth), height: Math.round(cropHeight) };