Round the numbers
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 5 Dec 2024 10:48:06 +0000 (11:48 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 5 Dec 2024 10:48:06 +0000 (11:48 +0100)
ts/WoltLabSuite/Core/Component/Image/Cropper.ts

index 7ac8922f28e87c6582d70f95cc59d4cd7bff14fc..72479511ca1aa900290a3406b186b5fa025a957c 100644 (file)
@@ -173,10 +173,10 @@ abstract class ImageCropper {
 
       const cropperImageRect = this.cropperImage!.getBoundingClientRect();
       const maxSelection: Selection = {
-        x: cropperImageRect.left - cropperCanvasRect.left,
-        y: cropperImageRect.top - cropperCanvasRect.top,
-        width: cropperImageRect.width,
-        height: cropperImageRect.height,
+        x: Math.round(cropperImageRect.left - cropperCanvasRect.left),
+        y: Math.round(cropperImageRect.top - cropperCanvasRect.top),
+        width: Math.round(cropperImageRect.width),
+        height: Math.round(cropperImageRect.height),
       };
 
       if (!inSelection(selection, maxSelection)) {