dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 985 forks source link

Drawing a line of thickness 1 issue #11461

Closed gc-maximloverov closed 5 months ago

gc-maximloverov commented 5 months ago

.NET version

8.0

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No

Issue description

When I draw a line of thickness 1 using the Graphics.DrawLine method, then the length of the line becomes larger by 1. If I draw a line with a thickness greater than 1 along the same coordinates, then its length will be correct. Changing property Graphics.SmoothingMode to None does not affect the result. Also, methods Graphics.DrawPolygon and Graphics.DrawPath have the same issue. изображение

Steps to reproduce

  1. Run attached app: DrawLineIssue.zip
  2. Observe incorrect result.
merriemcgaw commented 5 months ago

This is how GDI+ is working in these scenarios. This is not something that the WinForms team is able to impact. This is the design of GDI+ and would not be changing given how many applications are designed and working today. Any changes could be extremely breaking.

gc-maximloverov commented 5 months ago

Ok.