1
0

L'OQLF est passée.

This commit is contained in:
MarcEricMartel 2023-11-12 07:10:32 -05:00
parent 4b18317d35
commit 157babcbb9

View File

@ -8,23 +8,32 @@
@inject IJSRuntime jsRuntime @inject IJSRuntime jsRuntime
<header> <header>
<h3>On dessine en gang!</h3> <h3>Canvas Communautaire!</h3>
<label>Color: </label> <label>Couleur: </label>
<select @bind="@currentcolor"> <select @bind="@currentcolor">
<option value="Black" selected>Black</option> <option value="Black" selected>Noir</option>
<option value="Red">Red</option> <option value="Red">Rouge</option>
<option value="Blue">Blue</option> <option value="Blue">Bleu</option>
<option value="Green">Green</option> <option value="Green">Vert</option>
<option value="Yellow">Yellow</option> <option value="Yellow">Jaune</option>
<option value="DarkRed">Dark Red</option> <option value="DarkRed">Bourgogne</option>
<option value="Gray">Gray</option> <option value="DarkBlue">Bleu nuit</option>
<option value="DarkGreen">Vert forêt</option>
<option value="LightBlue">Cyan</option>
<option value="LightGreen">Jade</option>
<option value="LightYellow">Jaune pâle</option>
<option value="Gray">Gris</option>
<option value="White">Blanc</option>
</select> </select>
<label>Point Size: </label> <label>Grosseur du trait: </label>
<select @bind="@pointsize"> <select @bind="@pointsize">
<option value="1" selected>1</option> <option value="1" selected>1</option>
<option value="2">2</option> <option value="2">2</option>
<option value="3">3</option> <option value="3">3</option>
<option value="4">4</option> <option value="4">4</option>
<option value="8">8</option>
<option value="16">16</option>
<option value="32">32</option>
</select> </select>
</header> </header>
<div @ref="divCanvas" @onmousemove="OnMouseMove" style="border:1px solid #000000;"> <div @ref="divCanvas" @onmousemove="OnMouseMove" style="border:1px solid #000000;">
@ -44,8 +53,7 @@
if (eventArgs.Buttons == 0) if (eventArgs.Buttons == 0)
return; return;
if (divCanvas.Id?.Length > 0) if (divCanvas.Id?.Length > 0) {
{
string data = await jsRuntime.InvokeAsync<string>("getDivCanvasOffsets", string data = await jsRuntime.InvokeAsync<string>("getDivCanvasOffsets",
new object[] { divCanvas }); new object[] { divCanvas });
JObject? offsets = (JObject?)JsonConvert.DeserializeObject(data); JObject? offsets = (JObject?)JsonConvert.DeserializeObject(data);
@ -59,7 +67,6 @@
await currentCanvasContext.SetFillStyleAsync(currentcolor); await currentCanvasContext.SetFillStyleAsync(currentcolor);
await currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize); await currentCanvasContext.FillRectAsync(mouseX, mouseY, pointsize, pointsize);
} }
} }
} }