Bug: DrawLine doesn't draw pixels where line segments overlap. #339
|
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): Attached is the output bitmap. |
Replies: 3 comments 2 replies
|
Now that I'm thinking of it some more, also you have to consider how to handle drawing semi transparent pixels when drawing overlapping lines, e.g. when drawing a 20% opaque pixel. Would at the overlap be the result a 20% opaque pixel, or 0.2 x 0.2 for a single overlap (as if performing DrawLine twice for both line segments individually? |
|
Better late than never but my new PR #377 that rewrites the library to centre around a new |


Better late than never but my new PR #377 that rewrites the library to centre around a new
DrawingCanvas<TPixel>type contains a fix for this. We intentionally stripping collinear points during simplification but failed to consider points that represent a direction reversal (U-turn) within a single segment.