Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

cargo fmt

Brandon Thomas91ee7bf1b384
diff --git a/crates/effects/src/channel3d.rs b/crates/effects/src/channel3d.rs
index 0d089ba24..7884e8084 100644
--- a/crates/effects/src/channel3d.rs
+++ b/crates/effects/src/channel3d.rs
@@ -386,7 +386,13 @@ type RankPlanes<'a> = [(&'a [f32], &'a [f32])];
/// ranks (the Cryptomatte spec's matte), clamped to 0..1.
#[inline]
fn crypto_matte(planes: &RankPlanes, sel: &[u32], i: usize) -> f32 {
- planes.iter().filter_map(|(id, c)| Some((*id.get(i)?, *c.get(i)?))).filter(|(id, c)| *c > 0.0 && sel.contains(&id.to_bits())).map(|(_, c)| c).sum::<f32>().clamp(0.0, 1.0)
+ planes
+ .iter()
+ .filter_map(|(id, c)| Some((*id.get(i)?, *c.get(i)?)))
+ .filter(|(id, c)| *c > 0.0 && sel.contains(&id.to_bits()))
+ .map(|(_, c)| c)
+ .sum::<f32>()
+ .clamp(0.0, 1.0)
}
/// The coverage-weighted ID colours at aux pixel `i` (the spec's preview).
diff --git a/crates/ui-egui/src/panels/shortcut_editor.rs b/crates/ui-egui/src/panels/shortcut_editor.rs
index 14d317fb0..440ca6394 100644
--- a/crates/ui-egui/src/panels/shortcut_editor.rs
+++ b/crates/ui-egui/src/panels/shortcut_editor.rs
@@ -226,7 +226,10 @@ pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) {
// Enter is OK, unless it belongs to the rename field, an open preset menu or the delete
// confirmation (where Enter is not Delete). A recorded Enter never gets here: the recorder
// took the frame's key events above.
- close |= st.rename.is_none() && st.confirm_delete.is_none() && !egui::Popup::is_any_open(ctx) && ctx.input(|i| i.modifiers.is_none() && i.key_pressed(egui::Key::Enter));
+ close |= st.rename.is_none()
+ && st.confirm_delete.is_none()
+ && !egui::Popup::is_any_open(ctx)
+ && ctx.input(|i| i.modifiers.is_none() && i.key_pressed(egui::Key::Enter));
// Modifiers: toggles, or the ones held on the keyboard.
let held = ctx.input(|i| i.modifiers);
let held = [held.ctrl && cfg!(target_os = "macos"), held.command, held.alt, held.shift];