Skip to content
Open
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions src/BitooBitImageEditor/Helper/SKCanvasExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,33 @@ internal static void DrawPath(this SKCanvas canvas, List<PaintedPath> completedP
}
}
}
internal static void DrawPath(this SKCanvas canvas, List<PaintedPath> completedPaths, List<PaintedPath> inProgressPaths)
{
using (SKPaint paint = new SKPaint())
{
paint.Style = SKPaintStyle.Stroke;
paint.StrokeWidth = 10;
paint.StrokeCap = SKStrokeCap.Round;
paint.StrokeJoin = SKStrokeJoin.Round;
paint.IsAntialias = true;

if (completedPaths != null)
foreach (PaintedPath path in completedPaths)
{
paint.Color = path.Color;
canvas.DrawPath(path.Path, paint);
}

if (inProgressPaths != null)
foreach (PaintedPath path in inProgressPaths)
{
paint.Color = path.Color;
canvas.DrawPath(path.Path, paint);
}


}
}

internal static void DrawSurrounding(this SKCanvas canvas, SKRect outerRect, SKRect innerRect, SKColor color)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void OnPaintSurface(SKCanvas canvas, SKRect rect, bool isDrawResult, flo
canvas.Save();
canvas.SetMatrix(new SKMatrix(scale, 0, transX * scale, 0, scale, transY * scale, 0, 0, 1));
canvas.DrawBitmap(mainBitmap, transX, transY, scale);
canvas.DrawPath(completedPaths, isDrawResult ? null : inProgressPaths);
canvas.DrawPath(completedPaths.ToList(), isDrawResult ? null : inProgressPaths?.Values.ToList());
canvas.Restore();
canvas.DrawBitmap(bitmapCollection, transX, transY, scale);
}
Expand Down