fix(ui): tooltip wrap bound comes from the popup text child's authored P0x3D, and tooltip text left-aligns
Owner screenshots vs retail at the CA5 re-check caught both: Wrap width: the popup skins' shared TEXT CHILD (0x10000396) authors P0x3D=256 on all four skins — live-DAT probed, now pinned by an installed-DAT test. Retail's InqSizewMargins UITS_MAX_WIDTH reads the text element's 0x3D BEFORE the display-width fallback, so retail wraps tooltip text at 256px; our measure pass used the display width because TS-85's 'zero elements author P0x3D' sweep had only covered hover TARGETS, never the popup skins. ApplyTooltipText now measures and re-wraps at the text child's authored bound, falling back to the display width only when none is authored. Alignment: tooltip text rendered centered where retail hugs the left edge. The skin authors no justification; retail's unauthored default is Left, our importer's ElementInfo default is Center — the same wrong-default class as #410's VJustify finding, now recorded there as the horizontal sibling. Point-fixed in the presenter exactly as the chat transcript already does; the client-wide default flip stays #410's scope. The two-pass sizing test now models the real skin (max width on the text child) and asserts left alignment. Full hermetic suite 15,332 passed / 0 failed; the new live-DAT pin passes against the installed DATs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
1e8596a440
commit
d087b50aa3
4 changed files with 88 additions and 6 deletions
|
|
@ -492,14 +492,18 @@ public sealed class RetailTooltipPresenterTests
|
|||
|
||||
UiElement popup = root.Children[^1];
|
||||
Assert.True(root.Children.Count > childrenBefore, "popup did not mount");
|
||||
Assert.True(popup.Width <= 200f, $"popup width {popup.Width} escaped the clamp");
|
||||
// Root = authored 30 frame grown to hold the <=200 text plus padding.
|
||||
Assert.True(popup.Width <= 200f + 30f, $"popup width {popup.Width} escaped the clamp");
|
||||
var text = FindText(popup);
|
||||
Assert.NotNull(text);
|
||||
// Retail's unauthored justification default is LEFT (#410 class).
|
||||
Assert.False(text!.Centered);
|
||||
Assert.False(text.RightAligned);
|
||||
var lines = text!.LinesProvider();
|
||||
Assert.True(lines.Count >= 3,
|
||||
$"expected the clamped width to force >=3 lines, got {lines.Count}");
|
||||
// Every re-wrapped line must fit the clamped popup.
|
||||
Assert.All(lines, l => Assert.True(l.Text.Length * 8f <= 200f + 8f));
|
||||
Assert.All(lines, l => Assert.True(l.Text.Length * 8f <= 200f + 8f, $"line escaped wrap: {l.Text}"));
|
||||
// The root grew to hold the extra lines.
|
||||
float lineHeight = 14f;
|
||||
Assert.True(popup.Height >= lines.Count * lineHeight,
|
||||
|
|
@ -508,12 +512,15 @@ public sealed class RetailTooltipPresenterTests
|
|||
|
||||
private static void HoverAndDwellWithClampedPopup(UiRoot root, int maxWidth)
|
||||
{
|
||||
// A presenter whose popup skin authors ResizeMaxWidth, mirroring the
|
||||
// parchment skins' bounded frames.
|
||||
// The REAL skins bound the wrap on the TEXT CHILD: 0x10000396
|
||||
// authors P0x3D=256 on all four popup skins (live-DAT probed
|
||||
// 2026-08-24) — retail's InqSizewMargins UITS_MAX_WIDTH reads the
|
||||
// text element's 0x3D before the display-width fallback.
|
||||
var presenter = new RetailTooltipPresenter(root, (_, _) =>
|
||||
{
|
||||
ImportedLayout layout = BuildPopup();
|
||||
layout.Root.AuthoredResizeMaxWidth = maxWidth;
|
||||
if (layout.FindElement(TextChildId) is { } textChild)
|
||||
textChild.AuthoredResizeMaxWidth = maxWidth;
|
||||
return layout;
|
||||
});
|
||||
HoverAndDwell(root);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue