Merge pull request #4881 from Silvertree2010/fix/h4725-enhanced-preset-gives-high-fidel

Fix enhanced_preset Shapes for decorated High Fidelity Photo names
This commit is contained in:
BFlat
2026-10-31 21:02:23 +07:00
committed by GitHub
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:?}");
}
}