Skip to content

Fix modern RadioButton glyph clipping in RTL layouts - #14904

Open
LeafShi1 wants to merge 3 commits into
dotnet:mainfrom
LeafShi1:Fix_14898_RadioButton_glyph_clipping_in_RTL_layouts
Open

Fix modern RadioButton glyph clipping in RTL layouts#14904
LeafShi1 wants to merge 3 commits into
dotnet:mainfrom
LeafShi1:Fix_14898_RadioButton_glyph_clipping_in_RTL_layouts

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Aug 19, 2026

Copy link
Copy Markdown
Member

Fixes #14898

Proposed changes

  • Added DPI-aware glyph padding in RadioButtonModernAdapter, preventing RTL hover clipping
  • Added regression coverage in RadioButtonTests

Customer Impact

  • RadioButton glyphs now render correctly without clipping when using RightToLeft.Yes with .NET 11 visual styles, including during mouse hover. The change also respects DPI scaling.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

In .NET 11 visual styles, a RadioButton with RightToLeft.Yes displayed a clipped glyph when hovered with the mouse.

image

After

The RadioButton glyph has DPI-aware padding and renders fully without clipping in RTL layouts during mouse hover.

AfterChange.mp4

Test methodology

  • Manually and unit test

Test environment(s)

  • .net11.0.0-rc.1.26411.119
Microsoft Reviewers: Open in CodeFlow

@LeafShi1
LeafShi1 requested a review from a team as a code owner August 19, 2026 06:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a WinForms rendering issue where the modern RadioButton glyph can clip on hover in right-to-left (RTL) layouts under .NET 11 visual styles, and adds a regression test intended to cover the scenario.

Changes:

  • Add DPI-aware glyph padding in RadioButtonModernAdapter to avoid RTL hover clipping.
  • Add a regression test for RTL + hover rendering behavior in RadioButtonTests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/ButtonInternal/RadioButtonModernAdapter.cs Adds DPI-aware check padding for modern RadioButton layout to prevent glyph clipping.
src/test/unit/System.Windows.Forms/System/Windows/Forms/RadioButtonTests.cs Adds a regression test targeting RTL hover clipping behavior for modern glyph rendering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/test/unit/System.Windows.Forms/System/Windows/Forms/RadioButtonTests.cs Outdated
@SimonZhao888

Copy link
Copy Markdown
Member

Looks good to me!

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The icon of RadioButton is not render well when using the mouse focus on it with setting RightToLeft as Yes in NET 11 mode

3 participants