Commit Graph
2 Commits
Author SHA1 Message Date
joywayerandClaude Opus 5 8d6d272f76 二七王:LayoutSolver grid 补显式失败校验,attach 四角补精确坐标测试
审查发现 _solveGrid 在 count > cols*rows 时静默截断多出的项,违反显式失败
红线;补校验直接抛错并报出 count 与容量。fillOrder 字段之前从未被读取、
形同虚设,改为显式拒绝除 'row' 外的值(不实现列优先,YAGNI)。
测试补 grid 超载/恰好满格/fillOrder 三态,以及 attach 四角(topLeft/
bottomLeft/bottomRight)的精确坐标核对(此前只有 topRight 有精确值)。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 20:15:57 +08:00
joywayerandClaude Opus 5 2d0469e7f3 二七王:前端 LayoutSolver,五型布局求解器
solve 是纯函数(attach 靠 ctx.rects 查目标矩形而非反查引擎),
fan 的 clamp 间距算法只此一处实现;line 带 items 时自行按累计宽度推进,
不走假设等宽的 distribute。未知 kind/缺参/target 缺失一律抛错,不兜底。
apply 是唯一触碰 SpriteManager 的三行封装。

测试里 attach 外侧右上角一条按 AlignmentUtils.alignCornerTopRight 的真实实现
(角对角重合,非贴外侧)修正了期望值,未在求解器里做偏移补偿迁就猜测值。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 20:09:26 +08:00