diff --git a/crates/app-iced/src/components/gallery/probe.rs b/crates/app-iced/src/components/gallery/probe.rs index 5ee5f0b..8f30f2d 100644 --- a/crates/app-iced/src/components/gallery/probe.rs +++ b/crates/app-iced/src/components/gallery/probe.rs @@ -34,6 +34,17 @@ fn ui(flavor: SchemeFlavor) -> Ui { Ui::with_platform(flavor, Platform::Windows, FAMILIES) } +/// `ULL_GALLERY_SHOT` → 截图路径(相对路径按**工作区根**解释:`cargo test` 的 cwd 是 crate 目录)。 +fn shot_path() -> Option { + let raw = std::env::var_os("ULL_GALLERY_SHOT")?; + let path = std::path::PathBuf::from(raw); + if path.is_absolute() || path.exists() { + return Some(path); + } + let root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../.."); + Some(root.join(path)) +} + /// 一条测试覆盖全部几何断言(每张图各跑一次)。 #[test] fn gallery_geometry_matches_the_tokens() { @@ -71,6 +82,10 @@ fn gallery_geometry_matches_the_tokens() { let mut label_button = None; for bbox in &primary { + // 字形(OnPrimary)会把实心块割出小碎片,只判「成块的」(40×40 = 1600) + if bbox.area() < 800 { + continue; + } assert!( (39..=41).contains(&bbox.height()), "实心块高 {}(参考 40,12b 1.1)@ {:?}",