Microsoft.Maui.Graphics
Microsoft.Maui.Graphics copied to clipboard
Define pixel center
Currently when I draw a single width black line on an integer pixel coordinate (e.g. [100, 100]) in Microsoft.Maui.Graphics.Win2D.WinUI
I get a grey 2 pixel width line instead. Is there some definition for all backends where the pixel center should be? I honestly don't care if it is in a corner or in the center, as long as it is consistent on all backends.
The same things happens with rectangles. A filled rectangle is placed nicely within the bounds, while a stroked rectangle needs offsets to make sure it is a single line wide. I'm considering just using rectangles instead of lines for all horizontal or vertical lines.
@rick-palmsens This is the expected behavior, and it's consistent across all implementations. If you want a 1 pixel line to draw on pixel boundaries, you should translate your canvas by .5, .5f before issuing drawing commands.