Corrigé l'offse de scroll
This commit is contained in:
parent
7037e17965
commit
0704cb821c
@ -25,7 +25,7 @@ public class CanvasService {
|
||||
|
||||
public async void OnMouseMove(MouseEventArgs eventArgs) {
|
||||
double mouseX = 0, mouseY = 0;
|
||||
|
||||
|
||||
if (eventArgs.Buttons == 0 || eventArgs.Buttons > 2)
|
||||
return; // Rien faire si aucun bouton est appuyé ou si les deux boutons/ d'autres boutons sont appuyés.
|
||||
|
||||
@ -37,8 +37,8 @@ public class CanvasService {
|
||||
JObject? offsets = (JObject?)JsonConvert.DeserializeObject(data);
|
||||
|
||||
if (offsets is not null && offsets.HasValues) { // Translation entre le canvas et la souris.
|
||||
mouseX = eventArgs.ClientX - offsets.Value<double>("offsetLeft");
|
||||
mouseY = eventArgs.ClientY - offsets.Value<double>("offsetTop");
|
||||
mouseX = eventArgs.PageX - offsets.Value<double>("offsetLeft");
|
||||
mouseY = eventArgs.PageY - offsets.Value<double>("offsetTop");
|
||||
}
|
||||
if (_currentCanvasContext is null)
|
||||
_currentCanvasContext = await myCanvas.CreateCanvas2DAsync();
|
||||
|
Loading…
Reference in New Issue
Block a user