Repository navigation
fix(SelectableTextBlock): fix SelectableTextBlock selection for centered and right-aligned text - #21369
Conversation
…red and right-aligned text
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
|
Updated. I removed the clamping and now pass the layout-relative pointer position directly to TextLayout.HitTestPoint. |
# Conflicts: # src/Avalonia.Controls/SelectableTextBlock.cs # tests/Avalonia.Controls.UnitTests/SelectableTextBlockTests.cs
|
You can test this PR using the following package version. |
…red and right-aligned text (AvaloniaUI#21369) * fix(SelectableTextBlock): fix SelectableTextBlock selection for centered and right-aligned text * Fix failing unit tests * Let TextLayout handle out-of-bounds hit testing --------- Co-authored-by: Julien Lebosquain
What does the pull request do?
Fix SelectableTextBlock selection for centered and right-aligned text
What is the current behavior?
SelectableTextBlock cannot select all text when text is centered or right-aligned.
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
This change updates the drag-selection hit-testing logic to clamp against the available layout width when appropriate, allowing selection to extend to the visual end of the text for non-left-aligned content.
Also added regression tests covering drag selection with Center and Right text alignment.
Checklist
Fixed issues
Fixes #21368