mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 13:47:21 -06:00
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:
@@ -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