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

Use default brush for borders #5213

Merged
merged 5 commits into from
Jun 15, 2020
Merged

Conversation

kmelmon
Copy link
Contributor

@kmelmon kmelmon commented Jun 15, 2020

Fixes #4682

On other platforms, borders draw a solid color (black) by default if no brush color is specified. On Windows, we are drawing transparent.

This change fixes the mismatch by using a default brush when no brush color is specified. The default brush will be a theme brush that draws black on light theme, and white on dark theme.

A couple optimizations:
1 - the brush is cached in a per-UI-thread singleton class, as looking up the theme resource isn't free
2 - the default brush is only set if the border has thickness, to avoid the cost of setting a brush in the case where nothing draws

Microsoft Reviewers: Open in CodeFlow

@kmelmon kmelmon marked this pull request as ready for review June 15, 2020 20:26
@kmelmon kmelmon requested a review from a team as a code owner June 15, 2020 20:26
@NickGerleman NickGerleman added the Breaking Change This PR will break existing apps and should be part of the known breaking changes for the release label Jun 15, 2020
@NickGerleman
Copy link
Collaborator

Marking as breaking since this is a behavior change we may want to document.

@kmelmon kmelmon merged commit c9a2cc1 into microsoft:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Borders and Brushes Breaking Change This PR will break existing apps and should be part of the known breaking changes for the release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

borderColor draws black by default on all other platforms, but draws transparent on Windows
2 participants