Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Improvements to border rendering #1953

Open
BreeceW opened this issue Feb 7, 2020 · 7 comments
Open

Discussion: Improvements to border rendering #1953

BreeceW opened this issue Feb 7, 2020 · 7 comments
Assignees
Labels
discussion General discussion group-blurry A group of issues related to blurriness. team-Rendering Issue for the Rendering team

Comments

@BreeceW
Copy link
Contributor

BreeceW commented Feb 7, 2020

Discussion: Borders and lines in XAML occasionally blurred

Border
Above is a screenshot of the XAML Controls Gallery app showing off the newly introduced rounded corner default styles on a TextBox. Given for comparison below is a similarly styled HTML input rendered in the new Chromium-based Edge. The Edge-rendered input has uniform color throughout the sides of the border, and only does any anti-aliasing on the corners itself. This looks crisp on monitors of all pixel densities. Contrast that with the XAML TextBox, where setting CornerRadius appears to activate some kind of anti-aliasing on the whole border, leaving the edges of the border to appear undesirably blurry and almost with an unintentional glowing effect. This was not the case when TextBox was squared. The issue here is not that the TextBox is rounded, but what that rounding does to the rendering of the TextBox.

Please note that the bottom text also has ClearType enabled, though that is an unrelated issue.

While this issue is significantly more important now that so many of the controls have rounded styles by default (which seems to activate this rendering issue), it’s worth pointing out that this issue is not unique to WinUI 2 nor to rounded corners.
image
Most notably, it has always affected CheckBox (above, the Settings app, below XAML Controls Gallery).
Here is another example with HyperlinkButton (from XAML Controls Gallery):
image
Curiously, the extra anti-aliasing line (that is, the thin, light stroke that appears around affected borders), is rendered below the underline in the first example, and above in the second. This again makes the controls look undesirable. Sometimes this blurriness appears to be linked to DPI scaling settings, but at least in the rounded corner TextBox example, it occurs even at 100% scaling. All screenshots here are at 125% scaling.

To me, it’s important that WinUI is able to render controls that look as good or better than web browsers. I’d like to hear other’s thoughts on how WinUI should be rendering across a variety of screens and how we can make sure that our applications look crisp and high quality and hopefully lead to improvements in the platform.

@BreeceW BreeceW added the discussion General discussion label Feb 7, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Feb 7, 2020
@ranjeshj ranjeshj added the team-Rendering Issue for the Rendering team label Feb 7, 2020
@robloo
Copy link
Contributor

robloo commented Feb 7, 2020

This discussion might be related:
#1894 (comment)

@codendone codendone removed the needs-triage Issue needs to be triaged by the area owners label Feb 15, 2020
@ischmal
Copy link

ischmal commented Mar 17, 2020

I'd second that this is a vital quality-of-life feature. These nuances have frustrated me for years with UWP.

Regardless of the memory overhead, I honestly believe Chromium-driven UIs look better than anything native for Windows right now. Fonts look great and edges are perfectly crisp and smooth. (I mean, look no further than the terrific polish on VSCode.)

@ghost
Copy link

ghost commented Jun 9, 2021

I discovered in #5099 that borders get blurry when using a SolidColorBrush, but when using a LinearGradientBrush or AcrylicBrush they'll be sharp as expected.

@codendone
Copy link
Contributor

There have been some fixes for this issue which will be in a future OS release. We're also bringing those fixes into WinUI 3.

@BreeceW
Copy link
Contributor Author

BreeceW commented Jul 8, 2021

There have been some fixes for this issue which will be in a future OS release. We're also bringing those fixes into WinUI 3.

It looks like great improvements have been made in the two Windows 11 preview releases (for system XAML/WUX)!

Here is what a WinUI TextBox from WinUI 2.6.1 with ControlsResourcesVersion="Version1" looks like on Windows 11 build 22000.65:
ControlsResourcesVersion1 TextBox focused
This is exactly what I wanted it to look like. This is such a good improvement. I had been using squared off controls in my app for this reason, but now I’m going to round them.

Here is a TextBox with ControlsResourcesVersion="Version2" in the same configuration:
ControlResourcesVersion2 TextBox focused
While the stripe on the bottom looks a little off with the top pixels of the accent-colored line being darker, maybe this could be fixed with just a style update in WinUI 2.x. Otherwise, this looks decent. Based on the TextBox_themeresources.xaml, it doesn’t look like this effect is intentional, though, so maybe more work on the system-side is needed.

These are great improvements and I’m really happy about them. There is, I think, a little more room for improvement (like the TextBox stripe, and especially see CheckBoxes below), so I would not close this issue just yet.
CheckBox from WinUI 2.6 with resources version 2

Thanks so much for working on this problem. It’s just a massive improvement already.

@krschau krschau added the group-blurry A group of issues related to blurriness. label Jun 24, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@yaira2
Copy link
Contributor

yaira2 commented Jul 28, 2023

@BreeceW has this been fully resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General discussion group-blurry A group of issues related to blurriness. team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

10 participants