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

Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined #17402

Merged
merged 10 commits into from
Nov 10, 2024

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Nov 1, 2024

What does the pull request do?

This PR makes sure the TextBlock is always measured with an infinite width and only aligns it to finite space in the arranging step.

What is the current behavior?

What is the updated/expected behavior with this PR?

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

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes: #17396
Might fix: #17376

@Gillibald Gillibald added backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 1, 2024
@avaloniaui-bot
Copy link

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

@Gillibald Gillibald changed the title Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined [WIP] Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Nov 3, 2024
@Gillibald Gillibald changed the title [WIP] Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Nov 6, 2024
@Gillibald
Copy link
Contributor Author

Add some render tests that is covering most measure / arrange scenarios

@Gillibald Gillibald changed the title Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined [WIP] Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Nov 6, 2024
@avaloniaui-bot
Copy link

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

@Gillibald Gillibald changed the title [WIP] Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Fix TextBlock TextAlignment issues when a HorizontalAlignment is defined Nov 7, 2024
@avaloniaui-bot
Copy link

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

5 similar comments
@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@Gillibald Gillibald added the customer-priority Issue reported by a customer with a support agreement. label Nov 7, 2024
@avaloniaui-bot
Copy link

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

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM!

@MrJul MrJul added this pull request to the merge queue Nov 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2024
@MrJul MrJul merged commit d411bd2 into AvaloniaUI:master Nov 10, 2024
10 checks passed
Gillibald added a commit to Gillibald/Avalonia that referenced this pull request Nov 14, 2024
…ned (AvaloniaUI#17402)

* Always measure TextBlock with infinite width

* Make sure the constraint is always fulfilled

* Add some tests

* Adjust tests because we no longer retain the TextLayout in the arrange pass
@Whiletru3
Copy link
Contributor

This bug is blocker for us as the Ribbon is messed up for every textblock. Is there any date for the next release ?

@Whiletru3
Copy link
Contributor

And this should be considered as backport to 11.2.x :)

maxkatz6 pushed a commit that referenced this pull request Nov 14, 2024
…ned (#17402)

* Always measure TextBlock with infinite width

* Make sure the constraint is always fulfilled

* Add some tests

* Adjust tests because we no longer retain the TextLayout in the arrange pass
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Nov 14, 2024
@grokys grokys added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-11.1.x backported-11.2.x customer-priority Issue reported by a customer with a support agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextBlock render position error in 11.2.0 Button content disappears in version 11.2.0-rc2
6 participants