improve:线擦擦除

This commit is contained in:
2025-11-15 18:06:36 +08:00
parent e7c2e92879
commit b918809dca
+13 -5
View File
@@ -391,12 +391,20 @@ namespace Ink_Canvas
{ {
var stroke = GetStrokeVisual(e.StylusDevice.Id).Stroke; var stroke = GetStrokeVisual(e.StylusDevice.Id).Stroke;
inkCanvas.Strokes.Add(stroke); if (stroke != null)
await Task.Delay(5); {
inkCanvas.Children.Remove(GetVisualCanvas(e.StylusDevice.Id)); inkCanvas.Strokes.Add(stroke);
await Task.Delay(5);
inkCanvas.Children.Remove(GetVisualCanvas(e.StylusDevice.Id));
inkCanvas_StrokeCollected(inkCanvas, inkCanvas_StrokeCollected(inkCanvas,
new InkCanvasStrokeCollectedEventArgs(stroke)); new InkCanvasStrokeCollectedEventArgs(stroke));
}
else
{
await Task.Delay(5);
inkCanvas.Children.Remove(GetVisualCanvas(e.StylusDevice.Id));
}
} }
catch (Exception ex) catch (Exception ex)
{ {