Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Numerics;
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Brushes;
using Microsoft.Graphics.Canvas.Geometry;
using Microsoft.Maui.Platform;
using Windows.Storage.Streams;
using Windows.UI.Input.Inking;
Expand Down Expand Up @@ -155,6 +156,12 @@ static void DrawStrokes(CanvasDrawingSession session,
return offscreen;
}

static readonly CanvasStrokeStyle roundStartEndCapCanvasStrokeStyle = new()
{
StartCap = CanvasCapStyle.Round,
EndCap = CanvasCapStyle.Round,
};

static void DrawInk(this CanvasDrawingSession session, IEnumerable<InkStroke> strokes)
{
foreach (var stroke in strokes)
Expand All @@ -167,7 +174,8 @@ static void DrawInk(this CanvasDrawingSession session, IEnumerable<InkStroke> st
session.DrawLine(
new Vector2((float)currentPoint.X, (float)currentPoint.Y),
new Vector2((float)nextPoint.X, (float)nextPoint.Y),
stroke.DrawingAttributes.Color, (float)stroke.DrawingAttributes.Size.Width);
stroke.DrawingAttributes.Color, (float)stroke.DrawingAttributes.Size.Width,
roundStartEndCapCanvasStrokeStyle);
}
}
}
Expand Down
Loading