You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code causes a strange line leaving the polygon to the right side:
`
using System.IO;
using System.Numerics;
using ImageSharp;
using ImageSharp.Drawing.Brushes;
using SixLabors.Shapes;
namespace Repro
{
public class Program
{
public static void Run()
{
Vector2[] Points = new[]
{
new Vector2( 8, 8 ),
new Vector2( 64, 8 ),
new Vector2( 64, 64 ),
new Vector2( 120, 64 ),
new Vector2( 120, 120 ),
new Vector2( 8, 120 )
};
using( Image ThisImage = new Image( 256, 128 ) )
{
ThisImage.Fill( new SolidBrush( new Color( 0xFF, 0xFF, 0xFF, 0xFF ) ) );
ThisImage.Fill( new SolidBrush( new Color( 0x00, 0x00, 0x00, 0xFF ) ), new Polygon( new LinearLineSegment( Points ) ) );
using( MemoryStream ThisBuffer = new MemoryStream() )
{
ThisImage.SaveAsPng( ThisBuffer );
byte[] ThisByteArray = ThisBuffer.ToArray();
File.WriteAllBytes( @"C:\Temp\Image.png", ThisByteArray );
}
}
}
}
}
`
The problem seems to be related to the fourth corner new Vector2( 120, 64 ) since slightly increasing the Y-coordinate no longer causes the line to appear: new Vector2( 120, 64.01f ):
The text was updated successfully, but these errors were encountered:
The root cause of this bug was in the SixLabors.Shapes library.
This has now been fixed, if you update your ImageSharp.Drawing.Paths to 1.0.0-alpha2-00068 (which is just updates our SixLabors.Shapes dependency) then your issue is resolved.
The fix landed in SixLabors.Shapes 0.1.0-alpha0007
The following code causes a strange line leaving the polygon to the right side:
`
using System.IO;
using System.Numerics;
using ImageSharp;
using ImageSharp.Drawing.Brushes;
using SixLabors.Shapes;
`
The problem seems to be related to the fourth corner new Vector2( 120, 64 ) since slightly increasing the Y-coordinate no longer causes the line to appear: new Vector2( 120, 64.01f ):
The text was updated successfully, but these errors were encountered: