Repository navigation
Conversation
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26699/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248907 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26699/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248940 found UI Test snapshots differences: Details
|
Under FlowDirection RightToLeft, WinUI's TextAlignment Left/Right mean start/end, so a default-aligned TextBlock draws at the visual right. UnicodeText laid lines out unmirrored but read Left/Right as physical sides. Map element-level alignments to visual sides, treat Justify's last line as start-aligned, and honor DetectFromContent. Fixes #24904 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A uniform paragraph alignment reaches UnicodeText as the element-level alignment, which is now flow-relative, while mixed alignments arrive per line and were still read as physical sides. Under RightToLeft a paragraph jumped sides once another paragraph's alignment changed. Map all three sources the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Document that UnicodeText alignments are relative to its flowDirection and that its caller must not be mirrored, and share the width-dependence check between the empty and non-empty layout paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the right-to-left alignment tests out of the Skia-only block so the WinAppSDK head runs them too. Add Center, wrapped Justify, Hyperlink, FlowDirection change, default TextBox with LTR content, and a RichEditBox case that keeps a paragraph's side when alignments become mixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Native WinUI starts the unstretched last line of justified text where its own text starts: a RightToLeft TextBlock with Latin text puts it on the left, Arabic on the right, under either FlowDirection. Stop mapping Justify through the flow direction and align by the line's direction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0081b41 to
71f1cb0
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26699/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248954 found UI Test snapshots differences: Details
|
GitHub Issue: closes #24904
PR Type:
🐞 Bugfix
What changed? 🚀
Under
FlowDirection="RightToLeft", aTextBlockwith the defaultTextAlignmentdrew its text at the visual left edge on Uno; WinUI draws it at the right. WinUI mirrors a right-to-left text element, soTextAlignment.Left/Rightmean start/end. Uno suppresses that mirror for text surfaces (UIElement.GetFlowDirectionTransform) and lays lines out unmirrored, butUnicodeTextreadLeft/Rightas physical sides.UnicodeText: alignments are now relative to the element'sFlowDirectionand mapped to visual sides when a line is placed (draw, caret, selection and hit-testing all share that offset). TheTextBoxdefault (content-detected) alignment keeps its behavior.DetectFromContentnow picks the side from the text's direction; it used to behave likeLeft.Justify: the unstretched last line starts where its own text starts, whatever theFlowDirection(measured on native WinUI: right-to-left Latin text ends on the left, Arabic on the right).RichEditBox: per-paragraph and uniform paragraph alignments go through the same mapping, so a paragraph no longer jumps sides when another paragraph's alignment changes.doc/articles/migrating-to-uno-7/behavior.md(apps using an Uno-onlyTextAlignment="Right"workaround should drop it).RichTextBlockis unaffected (its ported WinUI layout already flips).Validation
Given_TextBlock(TextBlock rows for each alignment × flow × Latin/Arabic, Hyperlink, wrapped Justify,FlowDirectionchange, TextBox, RichEditBox uniform → mixed). With the fix reverted, the right-to-left rows fail (10/17 for the first version; the RichEditBox case fails without its fix). FullGiven_TextBlock*/Given_TextBox*/Given_RichEditBox*/Given_PasswordBox*run: 1553 cases, 0 failed.Justifyacross the width (kashida), which Uno doesn't do; those rows were left out.Known follow-ups (not in this PR)
DetectFromContent/ defaultTextBoxalignment reads the first logical run's direction rather than the paragraph level (e.g."123 שלום").TextBlockmeasured at infinite width and arranged wider still draws at the left.RichEditBoxparagraph alignment set before the control is loaded isn't rendered until the next format change.RichTextBlock: clicking a drawnHyperlinkdoes nothing, hit-testing ignores the RTL alignment flip #24748.PR Checklist ✅
Screenshots Compare Test Runresults.Behavior change: right-to-left
TextBlock/TextBox/RichEditBoxtext withLeft(default) orRightalignment moves to the other side, matching WinUI. Apps that setTextAlignment="Right"only on Uno to work around the old behavior should remove it (see the 7.0 migration note).🤖 Generated with Claude Code