Fix enhanced_preset Shapes for decorated High Fidelity Photo names

Found while testing crates/trace/src/params.rs:248-251 (enhanced_preset)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
NetterSilver
2026-10-31 20:44:04 +07:00
committed by bflatastic
co-authored by Claude Haiku 5.5
parent b0f6174c37
commit c0872ff9c6
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -247,5 +247,5 @@ pub fn presets() -> Vec<(&'static str, TraceParams)> {
/// Gradients stay an option to turn on. Flat Logo, a preset of our own, has none.
pub fn enhanced_preset(name: &str) -> Option<TraceParams> {
let p = preset(name).filter(|p| p.mode != Mode::Logo)?;
Some(TraceParams { auto_grouping: true, shapes: !name.eq_ignore_ascii_case("High Fidelity Photo"), ..p })
Some(TraceParams { auto_grouping: true, shapes: p != preset("High Fidelity Photo")?, ..p })
}
@@ -0,0 +1,13 @@
//! `enhanced_preset` resolves a name the way `preset` does (trimmed, brackets stripped, any case),
//! so Shapes is off for High Fidelity Photo however its name is written.
use vectorcraft_trace::enhanced_preset;
#[test]
fn enhanced_high_fidelity_photo_ignores_name_decoration() {
let plain = enhanced_preset("High Fidelity Photo").unwrap();
assert!(!plain.shapes);
for name in ["[High Fidelity Photo]", " High Fidelity Photo ", " high fidelity photo "] {
assert_eq!(enhanced_preset(name), Some(plain.clone()), "{name:?}");
}
}