fix(iced/feedback): 逐卡宽度/动作色精确判据、贴底边距、Dialog 下限与 icon 走 view_at
复审 r3 的 A/G/D/E 与随之冒出来的 clippy 项: - **A(p1,假绿)**:`7.6 Dialog 动作色` 原来量的是 `DialogActions::None` 那张卡的 bbox,且判据 是「离 Primary 更近」——标题/正文字形都被算进去(旧值 1790px)。现在:①判据换**精确色**; ②加两条反向证据(无动作那张卡里精确 Primary 必须为 0;有动作那张卡的下半区必须有字形行); ③量的是全图的动作字形(实测 362px,与复审独立复算一致)。变异:把 350 个动作字形涂成 `OnSurfaceVariant` → `7.6 实测只命中 12 px` → 红。 - **G**:Dialog 宽度改**逐卡**量(列剖面,排掉 scrim 色,深色档不会再把遮罩算成 1180 宽的假卡)。 环的逐环断言**登记为 G18-i**(实测 6 个环只有 3~4 个能被精确色簇干净命中,按簇数断言会把 「相位换了」误报成「环丢了」,理由写进 `probe/circular.rs` 模块文档)。 - **D**:两个 bottom 宿主 72 → 96,并给窄宿主画 1px 取景框;probe 新增「条底距宿主底 = 12」 (实测 `底边距 [11, 12]`)。取景框的描边不参与布局,所以宿主宽不变、条宽仍是 344/300。 - **E**:`DialogGeometry::effective_width` = `min(480, 可用宽).max(280)`(尊重官方下限); gallery 加一格 `Dialog::width(360)`;probe 逐卡断言实测 `[360, 480, 480, 480, 480]`。 - **C(按 tower 修正版)**:空态图标改用 M86 的 `icons::view_at(.., 32)`(先 rebase 到 main)。 - 顺带:`action.rs` 的 24 图标也走 `view_at(24)`——`icons.rs` 的守门测试按「逐文件调用点计数」 要求不在白名单里的文件 `icons::view` 为 0,本文件按盒尺寸烘一份(输出逐像素相同)。 - clippy:去掉 `needless_range_loop` 与未用变量,`-D warnings` 已绿。
This commit is contained in:
1 parent
5d7426b6c9
commit
11d7b64a5e
5 files changed
+76
-16
No files matched your search
@@ -275,10 +275,22 @@ fn check_snackbar(shot: &Shot, ui: &Ui) {
|
||||
if !(near(width, 300) || near(width, 344)) {
|
||||
continue;
|
||||
}
|
||||
// 1px 描边常落在半像素上(两行各 ~50% 覆盖),精确色匹配抓不住;
|
||||
// 用「更靠近框色而不是画布」判(这一带除了框没有别的灰线)。
|
||||
let distance = |pixel: [u8; 3], target: [u8; 3]| -> u32 {
|
||||
pixel
|
||||
.iter()
|
||||
.zip(target)
|
||||
.map(|(a, b)| u32::from(a.abs_diff(b)))
|
||||
.sum()
|
||||
};
|
||||
let frame_row = ((bottom + 1)..shot.height)
|
||||
.find(|y| {
|
||||
(0..shot.width)
|
||||
.filter(|x| matches(shot.at(*x, *y), frame))
|
||||
.filter(|x| {
|
||||
let pixel = shot.at(*x, *y);
|
||||
distance(pixel, frame) < distance(pixel, rgb(surface))
|
||||
})
|
||||
.count()
|
||||
>= 200
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user