Skip to content

Fix TextLayout.Width calculation (#18305) #18310

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

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

xoofx
Copy link
Contributor

@xoofx xoofx commented Feb 24, 2025

What is the current behavior?

TextLayout.UpdateMetrics was incorrectly calculating the Width for certain fonts. This caused a breaking change making 11.2.3+ not usable with certain projects.

What is the updated/expected behavior with this PR?

The Width should be now correctly calculated.

How was the solution implemented (if it's not obvious)?

Separate the update of the bounds from the different metrics updated (Width/Height...etc.)

Checklist

Breaking changes

None

Obsoletions / Deprecations

None

Fixed issues

Fixes #18305
Fixes #17809

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055127-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Feb 24, 2025

  • All contributors have signed the CLA.

@xoofx
Copy link
Contributor Author

xoofx commented Feb 24, 2025

@cla-avalonia agree

@timunie
Copy link
Contributor

timunie commented Feb 24, 2025

/cc @amwx if you want to test the build from this PR

@MrJul MrJul added bug backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 24, 2025
@MrJul MrJul requested a review from Gillibald February 24, 2025 20:33
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0055133-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Contributor

@Gillibald Gillibald left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

This looks so much cleaner.

@Gillibald Gillibald enabled auto-merge February 25, 2025 07:36
@Gillibald Gillibald added this pull request to the merge queue Feb 25, 2025
Merged via the queue into AvaloniaUI:master with commit 72caa3c Feb 25, 2025
10 checks passed
MrJul pushed a commit that referenced this pull request Feb 28, 2025
* Fix TextLayout.Width calculation (#18305)

* Use WinSymbols3.ttf
@MrJul MrJul added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 28, 2025
@xoofx xoofx mentioned this pull request Mar 14, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid Width calculation for a symbol with new TextLayout? Icons cropped (after update from 11.2.2 to 11.2.3)
8 participants