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

Wpf: Fix endless update cycles due to odd DPIs and wrapped labels #2043

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

cwensley
Copy link
Member

@cwensley cwensley commented Oct 19, 2021

We now only re-jig the layout if the desired height of a label is changed, vs. every time the width changes. In odd DPI sizes (e.g. 150%, 175%) the actual width of a label can get sizes different than assigned by the layout, which causes it to cycle layouts constantly going back and forth between two very similar widths.

Checking the desired height gets around this problem by only updating the preferred size when the height actually changes, which is why we were doing this to begin with. It is consequently more efficient and has fewer layout updates when resizing unless the number of lines in a label would actually change.

@cwensley cwensley added the bug label Oct 19, 2021
@cwensley cwensley added this to the 2.6.0 milestone Oct 19, 2021
@cwensley cwensley merged commit fa517dc into picoe:develop Oct 19, 2021
@cwensley cwensley deleted the curtis/wpf-label-wrap-dpi-issue branch October 19, 2021 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant