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
{{ message }}
Repository navigation
Bug: DrawLine doesn't draw pixels where line segments overlap. #344
Originally posted by woutware September 3, 2024
Tested with SixLabors.ImageSharp 3.1.5, SixLabors.ImageSharp.Drawing 2.1.4, .NET 6.0:
Program to reproduce (Only draws line from (10, 10) to (20, 10). The part where it draws over itself is not drawn):
using System;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.Fonts;
namespace ConsoleApp {
public static class SixLaborsBug {
public static void DrawLineBug2() {
Image<Bgra32> bitmap = new Image<Bgra32>(Configuration.Default, 100, 100, new Bgra32(0, 0, 0));
// Only draws line from (10, 10) to (20, 10). The part where it draws over itself is not drawn.
bitmap.Mutate(
context => {
context.DrawLine(Color.Aqua, 1f, new PointF(10, 10), new PointF(90, 10), new PointF(20, 10));
}
);
bitmap.Save(@"C:\tmp\DrawLineBug2.png");
}
}
}
Activity
Fix #344