winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Inline Documentation for GraphicsUnit.Display is incorrect.

Open JimBobSquarePants opened this issue 6 months ago • 2 comments

The documentation site has the correct value:

Specifies the unit of measure of the display device. Typically pixels for video displays, and 1/100 inch for printers.

https://learn.microsoft.com/en-us/dotnet/api/system.drawing.graphicsunit?view=windowsdesktop-9.0

However the linked source has the following, incorrect value:

Specifies 1/75 inch as the unit of measure.

https://github.com/dotnet/winforms/blob/ece6f6dbbacdcd43c32e1d33eed39ee3afe8934c/src/System.Drawing.Common/src/System/Drawing/GraphicsUnit.cs#L22

JimBobSquarePants avatar Jun 18 '25 13:06 JimBobSquarePants

I looked the history of GraphicsUnit.cs in winform repo, it has been 1/75 from the beginning. I also check .net framework. it is also 1/75.

https://referencesource.microsoft.com/#System.Drawing/commonui/System/Drawing/Advanced/Unit.cs,ddb40521c3cb3a5f

@JeremyKuhne what is your opinion?

Epica3055 avatar Jun 19 '25 01:06 Epica3055

1/75 doesn’t represent the actual behaviour which can be easily tested by measuring a string.

I looked the history of GraphicsUnit.cs in winform repo, it has been 1/75 from the beginning. I also check .net framework. it is also 1/75.

https://referencesource.microsoft.com/#System.Drawing/commonui/System/Drawing/Advanced/Unit.cs,ddb40521c3cb3a5f

@JeremyKuhne what is your opinion?

JimBobSquarePants avatar Jun 19 '25 04:06 JimBobSquarePants