From e8dcb700b5e5e092baabd093e614092699412c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=C4=8Dek?= Date: Fri, 18 Jul 2025 09:36:14 +0200 Subject: [PATCH] Cropping regression fix v2 --- src/lib/components/wizard/StepGallery.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) };