diff --git a/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs b/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs index e0dca97..8dd22c7 100644 --- a/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs +++ b/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs @@ -106,8 +106,10 @@ public class CanvasService { CanvasCommand command = new(); // Magnétisme boboche si activé, centrage si pas activé. - mouseX = eventArgs.OffsetX - (!snap? pointSize / 2: mouseX % pointSize); - mouseY = eventArgs.OffsetY - (!snap? pointSize / 2: mouseY % pointSize); + mouseX = eventArgs.OffsetX; + mouseX -= (!snap? pointSize / 2: mouseX % pointSize); + mouseY = eventArgs.OffsetY; + mouseY -= (!snap? pointSize / 2: mouseY % pointSize); if (eventArgs.Buttons == 1) // Couleur si bouton gauche, blanc si bouton droit color = currentColor;