mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-28 03:57:44 -06:00
co-authored by
Claude Opus 5.5
parent
6c799f3c3b
commit
91ee7bf1b3
@@ -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).
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user