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

Fixed an issue RTL wrapped text calculates an extra line for the control desired size #17209

Conversation

dme-compunet
Copy link
Contributor

@dme-compunet dme-compunet commented Oct 7, 2024

What does the pull request do?

This PR fixes an issue that RTL wrapped text calculates an extra line for the control desired size

What is the current behavior?

RTL wrapped text calculates an extra line for control desired size

What is the updated/expected behavior with this PR?

The text will take the required size without the empty line at end

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

In-depth investigation reveals that issue occurs because TextEndOfParagraph jumps to start of the text-runs array after bidi-reorder operation, causing the TextLayout.CreateTextLines() to add an unnecessary extra line at end.
The PR ensures that TextEndOfParagraph remains at end of the text-run array. Additionally, it corrects a unit test that was written in relation to this bug.

Checklist

Fixed issues

Fixes #16165
Fixes partly #17175

@avaloniaui-bot
Copy link

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

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Oct 7, 2024

  • All contributors have signed the CLA.

@MrJul MrJul requested a review from Gillibald October 7, 2024 21:40
@dme-compunet
Copy link
Contributor Author

@cla-avalonia agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052467-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-cibuild0052481-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@Gillibald Gillibald added the backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch label Oct 8, 2024
@MrJul
Copy link
Member

MrJul commented Oct 9, 2024

Thank you for your contribution!

@MrJul MrJul enabled auto-merge October 9, 2024 13:14
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052499-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-cibuild0052509-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added this pull request to the merge queue Oct 10, 2024
Merged via the queue into AvaloniaUI:master with commit e913c89 Oct 10, 2024
10 checks passed
maxkatz6 pushed a commit that referenced this pull request Oct 27, 2024
…rol desired size (#17209)

* Always Return 0 bidi level for TextEndOfLine run

* Fix test unit

* Expand the unit test

---------

Co-authored-by: Benedikt Stebner <[email protected]>
Co-authored-by: Julien Lebosquain <[email protected]>
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Oct 27, 2024
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.

Wrapped RTL text has extra bottom padding
6 participants