fix(ui): align Private Stash header and gold text inside TradeStash.dc6 recessed boxes (#493) #494
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/stash-text-align"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #493
Summary
D2FontRenderer.drawTextusesctx.textBaseline = 'alphabetic'(whereyis the glyph baseline, not the top edge). Passingoy + 26for the top header andoy + 48for the gold readout placed the first line on top of the upper gold frame (relY = 15..26vs boxrelY = 24..38) and the second line on the stone divider between the two boxes (relY = 39..48vs boxrelY = 49..65), leaving the bottom dark recess completely empty.Panel\TradeStash.dc6(public/ui/stash-bg.png) is split by a vertical divider atrelX = 94..96into a left20×15icon socket (relX = 74..93) and a right151×15text compartment (relX = 97..247, centerox + 172). Drawing私人储物箱 (Private Stash)infontexocet10(~168.25pxwide) centered atox + 160caused私to land inside the left square socket and人to straddle therelX = 94..96vertical divider.TradeStash.dc6header recess geometry constants (STASH_HEADER_ICON_SOCKET,STASH_HEADER_TOP_RECESS,STASH_HEADER_BOTTOM_RECESS) insrc/ui/world-panels.ts.私人储物箱 (Private Stash)inside the top-right recess (x = ox + 172, y = oy + 35,font: 'font8'width~129.8px < 151px) so it never crosses therelX = 94..96divider.储物箱金币: <amount>inside the bottom full-width recess (x = ox + 160, y = oy + 61,font: 'font8').tests/stash.test.ts(8. Stash Header Recessed Boxes & Text Alignment Parity (Issue #493)).