Skip to content

Commit

Permalink
fix issue BitooBit#17
Browse files Browse the repository at this point in the history
  • Loading branch information
andimairitsch committed Jul 22, 2021
1 parent e948686 commit 4fd6260
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
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

0 comments on commit 4fd6260

Please sign in to comment.