1919namespace TheArtOfDev . HtmlRenderer . SkiaSharp . Adapters
2020{
2121 /// <summary>
22- /// Adapter for WinForms graphics path object for core.
22+ /// Adapter for Skia graphics path object for core.
2323 /// </summary>
2424 internal sealed class GraphicsPathAdapter : RGraphicsPath
2525 {
2626 /// <summary>
27- /// The actual PdfSharp graphics path instance.
27+ /// The actual SKPath graphics path instance.
2828 /// </summary>
29- private readonly SKPath _graphicsPath = new SKPath ( ) ;
29+ private readonly SKPath _graphicsPath = new ( ) ;
3030
3131 /// <summary>
3232 /// the last point added to the path to begin next segment from
3333 /// </summary>
3434 private RPoint _lastPoint ;
3535
3636 /// <summary>
37- /// The actual PdfSharp graphics path instance.
37+ /// The actual SKPath graphics path instance.
3838 /// </summary>
3939 public SKPath GraphicsPath
4040 {
@@ -44,6 +44,7 @@ public SKPath GraphicsPath
4444 public override void Start ( double x , double y )
4545 {
4646 _lastPoint = new RPoint ( x , y ) ;
47+ _graphicsPath . MoveTo ( ( float ) x , ( float ) y ) ;
4748 }
4849
4950 public override void LineTo ( double x , double y )
@@ -56,12 +57,16 @@ public override void ArcTo(double x, double y, double size, Corner corner)
5657 {
5758 float left = ( float ) ( Math . Min ( x , _lastPoint . X ) - ( corner == Corner . TopRight || corner == Corner . BottomRight ? size : 0 ) ) ;
5859 float top = ( float ) ( Math . Min ( y , _lastPoint . Y ) - ( corner == Corner . BottomLeft || corner == Corner . BottomRight ? size : 0 ) ) ;
59- _graphicsPath . ArcTo ( left , top , ( float ) size * 2 , ( float ) size * 2 , GetStartAngle ( corner ) ) ;
60+
61+ var rect = SKRect . Create ( left , top , ( float ) size * 2 , ( float ) size * 2 ) ;
62+ _graphicsPath . ArcTo ( rect , GetStartAngle ( corner ) , 90f , false ) ;
6063 _lastPoint = new RPoint ( x , y ) ;
6164 }
6265
6366 public override void Dispose ( )
64- { }
67+ {
68+ _graphicsPath . Dispose ( ) ;
69+ }
6570
6671 /// <summary>
6772 /// Get arc start angle for the given corner.
0 commit comments