Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: DrawLine doesn't draw pixels where line segments overlap. #344

Open
JimBobSquarePants opened this issue Nov 6, 2024 Discussed in #339 · 0 comments
Open

Bug: DrawLine doesn't draw pixels where line segments overlap. #344

JimBobSquarePants opened this issue Nov 6, 2024 Discussed in #339 · 0 comments

Comments

@JimBobSquarePants
Copy link
Member

Discussed in #339

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");
        }
    }
}

Attached is the output bitmap.

DrawLineBug2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant