fix #430: tooltip wrap and draw honor the text child's authored margins
Third owner-screenshot round: acdream fit one more word per line than retail and drew glyphs flush against the popup's right border. Retail's InqSizewMargins @0x00469660 wraps the glyph list at (bound - m_margL - m_margR) and adds the margins back into the measured width; the popup skins' shared text child 0x10000396 authors margins L=2/R=2 (U=2/D=2 on three of the four skins — live-DAT probed). The presenter now subtracts the horizontal margins from both wrap passes, re-adds them into the measured width used for root sizing, and counts the vertical margins in the measured/re-wrapped heights; the widget's own draw already insets by all four margins (UiText ContentOffsetX + the top/bottom inset), so the right-side spacing returns for free. TooltipSkinLiveDatTests pins the authored margins per skin alongside the P0x3D=256 wrap bound; a new presenter test proves margins shrink the wrap bound and survive onto the widget. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d087b50aa3
commit
35abbe1d0d
3 changed files with 92 additions and 11 deletions
|
|
@ -29,16 +29,26 @@ public sealed class TooltipSkinLiveDatTests
|
|||
Assert.NotNull(tree);
|
||||
|
||||
int textChildren = 0;
|
||||
void Walk(ElementInfo e)
|
||||
void Walk(ElementInfo e, uint parentId)
|
||||
{
|
||||
if (e.Id == 0x10000396u && e.Type == 12)
|
||||
{
|
||||
textChildren++;
|
||||
Assert.Equal(256, e.MaxWidth);
|
||||
// Retail wraps at (256 - margL - margR) and draws inset by
|
||||
// the margins — the CA5 owner-screenshot delta (one extra
|
||||
// word on line one + text flush against the right border).
|
||||
// All four skins author L=2/R=2; skin 0x10000398 alone
|
||||
// authors no vertical margins (live-DAT probe 2026-08-24).
|
||||
Assert.Equal(2, e.MarginLeft);
|
||||
Assert.Equal(2, e.MarginRight);
|
||||
int vertical = parentId == 0x10000398u ? 0 : 2;
|
||||
Assert.Equal(vertical, e.MarginTop);
|
||||
Assert.Equal(vertical, e.MarginBottom);
|
||||
}
|
||||
foreach (var c in e.Children) Walk(c);
|
||||
foreach (var c in e.Children) Walk(c, e.Id);
|
||||
}
|
||||
Walk(tree!);
|
||||
Walk(tree!, 0);
|
||||
Assert.True(textChildren >= 4,
|
||||
$"expected the text child under all four popup skins, found {textChildren}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue