fix(ui): align Private Stash header and gold text inside TradeStash.dc6 recessed boxes #493
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
问题描述 (Problem Statement)
在打开储藏箱面板(
Panel\TradeStash.dc6/public/ui/stash-bg.png,320×432,绘制原点ox = 80, oy = 60)时,顶部两行文字与背景贴图中的两个黑色凹槽框(recessed boxes)严重错位:第一行标题
私人储物箱 (Private Stash):(ox + 160, oy + 26)且使用fontexocet10(bold 13px,渲染宽度约168.25px)。D2FontRenderer.drawText使用ctx.textBaseline = 'alphabetic'(y为字形基线而非顶部坐标)。传入oy + 26导致字形落在relY = 15..26,直接压在第一个凹槽框(relY = 24..38)的上沿金属边框(relY = 21..23)上,而凹槽框下半部分(relY = 27..38)完全空置。relX = 94..96的垂直金属分隔线切分为左侧小方格(relX = 74..93, relY = 24..38,20×15金币图标槽位)与右侧宽文本凹槽(relX = 97..247, relY = 24..38,宽度151px,水平中心为ox + 172)。按ox + 160居中且使用168.25px宽的fontexocet10导致私字落入左侧方格内、人字直接压在relX = 94..96的竖向分隔线上。第二行金币数额
储物箱金币: <amount>:(ox + 160, oy + 48)。relX = 75..246, relY = 49..65(宽高172×17,垂直中心relY = 57)。传入基线oy + 48导致整行文字落在relY = 39..48,完全处于上下两个凹槽框之间的石质分隔横梁上,而第二个凹槽框(relY = 49..65)内部完全为空。Ground Truth (
TradeStash.dc6&D2Client.dllv1.13c)对
public/ui/stash-bg.png(TradeStash.dc6)像素边界与D2Client.dll(0x6fb498d5..0x6fb49b29,0x6fb3cfb0..0x6fb3d2f7)进行精确测量:relX,relY)w × h)relX,relY)alphabetic垂直居中基线relX = 74..93, relY = 24..3820 × 15(83.5, 31.0)relX = 94..96, relY = 23..393 × 17relX = 97..247, relY = 24..38151 × 15(172.0, 31.0)x = ox + 172, y = oy + 35relX = 75..246, relY = 49..65172 × 17(160.5, 57.0)x = ox + 160, y = oy + 61修复方案 (Fix Plan)
src/ui/world-panels.ts中导出STASH_HEADER_TOP_RECESS与STASH_HEADER_BOTTOM_RECESS精确几何常量。relX = 97..247, relY = 24..38)内水平与垂直居中(x = ox + 172, y = oy + 35,使用font8确保约129.8px宽度完整落入151px凹槽内,不越过relX = 94..96竖向分隔线)。relX = 75..246, relY = 49..65)内水平与垂直居中(x = ox + 160, y = oy + 61)。tests/stash.test.ts中新增凹槽像素边界与文本绘制坐标回归测试,并通过 Headless Chromium 截图验证视觉对齐。