From 39eecd54c673d803a1c5a7b600dfe986cb050819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Tue, 4 Feb 2025 11:20:36 +0100 Subject: [PATCH] Part constructor raster-coordinates rounding --- src/main/angular/src/app/editor/parts/Part.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/angular/src/app/editor/parts/Part.ts b/src/main/angular/src/app/editor/parts/Part.ts index 0050049..5f73a2e 100644 --- a/src/main/angular/src/app/editor/parts/Part.ts +++ b/src/main/angular/src/app/editor/parts/Part.ts @@ -25,10 +25,10 @@ export abstract class Part { rasterW: number = 1, rasterH: number = 1, ) { - this.x = rasterX * 3 * RASTER; - this.y = rasterY * 3 * RASTER; - this.w = rasterW * 3 * RASTER; - this.h = rasterH * 3 * RASTER; + this.x = Math.round(rasterX * 3) * RASTER; + this.y = Math.round(rasterY * 3) * RASTER; + this.w = Math.round(rasterW * 3) * RASTER; + this.h = Math.round(rasterH * 3) * RASTER; } toString(): string {