dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7k stars 1.16k forks source link

WPF RadioButton bullet not centered #5518

Open vsfeedback opened 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] Create a WPF app using either .NET Framework 4.8 or .NET 5.0. Add one or more RadioButton elements. Run app and make a radio button checked. The dot in the RadioButton is drawn off center.


Original Comments

Feedback Bot on 10/14/2021, 11:51 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

vishalmsft commented 2 years ago

This is due to LayoutRounding decision. When radio buttons are presented, the rounding operation for buttons causes it. This is a known issue and a non-blocker.

appel1 commented 2 years ago

According to https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.uselayoutrounding?view=windowsdesktop-5.0 and https://docs.microsoft.com/en-us/dotnet/api/system.windows.uielement.snapstodevicepixels?view=windowsdesktop-5.0 both UseLayoutRounding and SnapsToDevicePixels are false på default. Is that not true or not true for RadioButton? Setting them explicitly to false does not seem to make any difference.

Krudonix commented 2 years ago

Hi,

We ran into the exact same problem.

We managed to find a work around which worked well for us.

Changing the default style by updating the markGrid margin from 2 to 3 worked wonders for us.

Hope this helps someone.

Regards,

fraluderin commented 5 months ago

Hi,

We ran into the exact same problem.

We managed to find a work around which worked well for us.

Changing the default style by updating the markGrid margin from 2 to 3 worked wonders for us.

Hope this helps someone.

Regards,

Tried this workaround but it's not working for me. Net 8.0.2, Win 11. It seems it's caused by display scaling: if I switch from 150% (default on my screen) to 100%, bullets get properly centered.

Are there any news on this issue?