Cleanup + commentaires
This commit is contained in:
parent
0704cb821c
commit
2875eda693
@ -23,6 +23,8 @@ public class CanvasService {
|
|||||||
public ElementReference divCanvas { get; set; }
|
public ElementReference divCanvas { get; set; }
|
||||||
public BECanvasComponent myCanvas { get; set; } = new();
|
public BECanvasComponent myCanvas { get; set; } = new();
|
||||||
|
|
||||||
|
// TODO: Dessiner à partir des commandes de Franz.
|
||||||
|
|
||||||
public async void OnMouseMove(MouseEventArgs eventArgs) {
|
public async void OnMouseMove(MouseEventArgs eventArgs) {
|
||||||
double mouseX = 0, mouseY = 0;
|
double mouseX = 0, mouseY = 0;
|
||||||
|
|
||||||
@ -43,7 +45,6 @@ public class CanvasService {
|
|||||||
if (_currentCanvasContext is null)
|
if (_currentCanvasContext is null)
|
||||||
_currentCanvasContext = await myCanvas.CreateCanvas2DAsync();
|
_currentCanvasContext = await myCanvas.CreateCanvas2DAsync();
|
||||||
|
|
||||||
|
|
||||||
if (eventArgs.Buttons == 1) // Couleur si bouton gauche, blanc si bouton droit
|
if (eventArgs.Buttons == 1) // Couleur si bouton gauche, blanc si bouton droit
|
||||||
color = currentcolor;
|
color = currentcolor;
|
||||||
|
|
||||||
@ -58,7 +59,9 @@ public class CanvasService {
|
|||||||
command.PointSize = pointsize;
|
command.PointSize = pointsize;
|
||||||
|
|
||||||
if (command.Equals(_lastCommand))
|
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.SetFillStyleAsync(color);
|
||||||
await _currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize);
|
await _currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user