1
0

camelCase

This commit is contained in:
MarcEricMartel 2023-11-12 11:17:03 -05:00
parent 2875eda693
commit 4e45032150
2 changed files with 10 additions and 10 deletions

View File

@ -17,8 +17,8 @@ public class CanvasService {
_jsRuntime = jsRuntime;
}
public string currentcolor { get; set; } = "Black";
public int pointsize { get; set; } = 1;
public string currentColor { get; set; } = "Black";
public int pointSize { get; set; } = 1;
public bool snap { get; set; }
public ElementReference divCanvas { get; set; }
public BECanvasComponent myCanvas { get; set; } = new();
@ -46,17 +46,17 @@ public class CanvasService {
_currentCanvasContext = await myCanvas.CreateCanvas2DAsync();
if (eventArgs.Buttons == 1) // Couleur si bouton gauche, blanc si bouton droit
color = currentcolor;
color = currentColor;
if (snap) { // Magnétisme boboche.
mouseX -= mouseX % pointsize;
mouseY -= mouseY % pointsize;
mouseX -= mouseX % pointSize;
mouseY -= mouseY % pointSize;
}
command.X = mouseX;
command.Y = mouseY;
command.Color = color;
command.PointSize = pointsize;
command.PointSize = pointSize;
if (command.Equals(_lastCommand))
return; // Pour pas spammer des commandes si c'est pas pertinent.
@ -64,7 +64,7 @@ public class CanvasService {
// TODO: Shipper les commandes à Franz.
await _currentCanvasContext.SetFillStyleAsync(color);
await _currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize);
await _currentCanvasContext.FillRectAsync(mouseX, mouseY, pointSize, pointSize);
_lastCommand = command;
}

View File

@ -11,7 +11,7 @@
<header style="padding: 5px;">
<h3>Canvas Communautaire!</h3>
<label>Couleur: </label>
<select @bind="@canvasService.currentcolor">
<select @bind="@canvasService.currentColor">
<option value="Black" selected>Noir</option>
<option value="Red">Rouge</option>
<option value="Blue">Bleu</option>
@ -27,7 +27,7 @@
<option value="White">Blanc</option>
</select>
<label>Grosseur du trait: </label>
<select @bind="@canvasService.pointsize">
<select @bind="@canvasService.pointSize">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
@ -43,5 +43,5 @@
<BECanvas @ref="canvasService.myCanvas" Height="1080" Width="1920"></BECanvas>
</div>
<footer>
(c) Cowboy Kim
© Cowboy Kim
</footer>