mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 13:47:21 -06:00
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:
committed by
bflatastic
co-authored by
Claude Haiku 5.5
parent
b0f6174c37
commit
c0872ff9c6
@@ -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:?}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user