修复了拖拽问题,并避免在拖拽时触发摸头

This commit is contained in:
Wreathlit 2023-03-09 13:34:16 +08:00
parent af42026dd8
commit 0cb2653600

View File

@ -157,10 +157,12 @@ namespace VPet_Simulator.Core
SmartMoveTimer.Start();
}
}
((UIElement)e.Source).ReleaseMouseCapture();
}
private void MainGrid_MouseMove(object sender, MouseEventArgs e)
{
((UIElement)e.Source).CaptureMouse();
var mp = e.GetPosition(MainGrid);
var x = mp.X - Core.Graph.GraphConfig.RaisePoint[(int)Core.Save.Mode].X;
var y = mp.Y - Core.Graph.GraphConfig.RaisePoint[(int)Core.Save.Mode].Y;
@ -203,6 +205,9 @@ namespace VPet_Simulator.Core
private DateTime wavespan;
private void MainGrid_MouseWave(object sender, MouseEventArgs e)
{
if (rasetype >= 0)
return;
if ((DateTime.Now - wavespan).TotalSeconds > 2)
{
wavetimes = 0;