From 2875eda69332b9edf82c89c54b48b1e43e304756 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sun, 12 Nov 2023 11:13:07 -0500 Subject: [PATCH] Cleanup + commentaires --- BlazorCanvas/BlazorCanvas/Data/CanvasService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BlazorCanvas/BlazorCanvas/Data/CanvasService.cs b/BlazorCanvas/BlazorCanvas/Data/CanvasService.cs index 0b2b521..47da918 100644 --- a/BlazorCanvas/BlazorCanvas/Data/CanvasService.cs +++ b/BlazorCanvas/BlazorCanvas/Data/CanvasService.cs @@ -23,6 +23,8 @@ public class CanvasService { public ElementReference divCanvas { get; set; } public BECanvasComponent myCanvas { get; set; } = new(); + // TODO: Dessiner à partir des commandes de Franz. + public async void OnMouseMove(MouseEventArgs eventArgs) { double mouseX = 0, mouseY = 0; @@ -43,7 +45,6 @@ public class CanvasService { if (_currentCanvasContext is null) _currentCanvasContext = await myCanvas.CreateCanvas2DAsync(); - if (eventArgs.Buttons == 1) // Couleur si bouton gauche, blanc si bouton droit color = currentcolor; @@ -58,7 +59,9 @@ public class CanvasService { command.PointSize = pointsize; if (command.Equals(_lastCommand)) - return; + return; // Pour pas spammer des commandes si c'est pas pertinent. + + // TODO: Shipper les commandes à Franz. await _currentCanvasContext.SetFillStyleAsync(color); await _currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize);