diff --git a/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/Erasing/PointPathEraserManager.cs b/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/Erasing/PointPathEraserManager.cs index 7dd528d35..14e937145 100644 --- a/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/Erasing/PointPathEraserManager.cs +++ b/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/Erasing/PointPathEraserManager.cs @@ -112,7 +112,7 @@ public PointPathEraserResult Finish() var skPath = ToPath(subInkInfoForEraserPointPath); var skiaStroke = SkiaStroke.CreateStaticStroke(InkId.NewId(), skPath, pointList, originSkiaStroke.Color, - originSkiaStroke.Width); + originSkiaStroke.InkThickness); newStrokeList.Add(skiaStroke); //result.Add(new SkiaStrokeDrawContext(subInkInfoForEraserPointPath.PointPath.OriginSkiaStroke.Color, skPath, skPath.Bounds.ToAvaloniaRect(), ShouldDisposePath: true)); } @@ -153,7 +153,7 @@ private static SKPath ToPath(SubInkInfoForEraserPointPath subInkInfoForEraserPoi { var pointList = new StylusPointListSpan(originSkiaStroke.PointList, subSpan.Start, subSpan.Length); - var outlinePointList = SimpleInkRender.GetOutlinePointList(pointList.ToReadOnlyList(), originSkiaStroke.Width); + var outlinePointList = SimpleInkRender.GetOutlinePointList(pointList.ToReadOnlyList(), originSkiaStroke.InkThickness); skPath.AddPoly(outlinePointList.Select(t => new SKPoint((float) t.X, (float) t.Y)).ToArray()); } diff --git a/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/SkiaStroke.cs b/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/SkiaStroke.cs index f4ed38639..e949c3b54 100644 --- a/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/SkiaStroke.cs +++ b/AvaloniaIDemo/NarjejerechowainoBuwurjofear/NarjejerechowainoBuwurjofear/Inking/SkiaStroke.cs @@ -25,12 +25,12 @@ private SkiaStroke(InkId id, SKPath path) Path = path; } - public InkId Id { get; init; } + public InkId Id { get; } public SKPath Path { get; } - public SKColor Color { get; set; } = SKColors.Red; - public float Width { get; set; } = 20; + public SKColor Color { get; init; } = SKColors.Red; + public float InkThickness { get; init; } = 20; public IReadOnlyList PointList => _pointList; private readonly List _pointList = []; @@ -67,7 +67,7 @@ public void AddPoint(StylusPoint point) if (pointList.Count > 2) { - var outlinePointList = SimpleInkRender.GetOutlinePointList(pointList, Width); + var outlinePointList = SimpleInkRender.GetOutlinePointList(pointList, InkThickness); Path.Reset(); Path.AddPoly(outlinePointList.Select(t => new SKPoint((float) t.X, (float) t.Y)).ToArray()); @@ -141,7 +141,7 @@ public static SkiaStroke CreateStaticStroke(InkId id, SKPath path, StylusPointLi var skiaStroke = new SkiaStroke(id, path) { Color = color, - Width = inkThickness, + InkThickness = inkThickness, }; skiaStroke._pointList.EnsureCapacity(pointList.Length); @@ -161,7 +161,7 @@ public Rect GetDrawBounds() return _drawBounds; } - return Path.Bounds.ToAvaloniaRect().Expand(Width); + return Path.Bounds.ToAvaloniaRect().Expand(InkThickness); } public void EnsureIsStaticStroke()