preset: fix wrong scale type when x/y scale specified

This commit is contained in:
chyyran 2022-10-20 23:23:20 -04:00
parent 1c18faa83e
commit cc295133c0
2 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ mod test {
#[test]
pub fn parse_preset() {
let root =
PathBuf::from("test/slang-shaders/bezel/Mega_Bezel/Presets/Base_CRT_Presets/MBZ__3__STD__MEGATRON-NTSC.slangp");
PathBuf::from("test/slang-shaders/ntsc/ntsc-256px-svideo.slangp");
let basic = Preset::try_parse(root);
eprintln!("{:#?}", basic);
assert!(basic.is_ok());

View file

@ -72,12 +72,12 @@ pub fn resolve_values(mut values: Vec<Value>) -> Preset {
});
let mut scale_type_x = shader_values.iter().find_map(|f| match f {
Value::ScaleType(_, value) => Some(*value),
Value::ScaleTypeX(_, value) => Some(*value),
_ => None,
});
let mut scale_type_y = shader_values.iter().find_map(|f| match f {
Value::ScaleType(_, value) => Some(*value),
Value::ScaleTypeY(_, value) => Some(*value),
_ => None,
});