mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-30 18:27:00 +01:00
craft-raster3d: wrap the shadow depth fallback to rustfmt's width
The lint job's cargo fmt --check failed on crates/raster3d/src/shade.rs:388: the last push left the f64 fallback for a non-finite light-space depth on one line past max_width, so rustfmt wants each term on its own line. The expression and its evaluation order are unchanged.
This commit is contained in:
1 parent
b37bb4aa6d
commit
d21ea00d7c
1 file changed
+4
-1
@@ -385,7 +385,10 @@ fn shadow_factor(m: &ShadowMap, texels: &[f32], p: [f32; 3], ng: [f32; 3], n_l:
|
||||
let z = if z.is_finite() {
|
||||
f64::from(z)
|
||||
} else {
|
||||
f64::from(w[2][0]) * f64::from(p[0]) + f64::from(w[2][1]) * f64::from(p[1]) + f64::from(w[2][2]) * f64::from(p[2]) + f64::from(w[2][3])
|
||||
f64::from(w[2][0]) * f64::from(p[0])
|
||||
+ f64::from(w[2][1]) * f64::from(p[1])
|
||||
+ f64::from(w[2][2]) * f64::from(p[2])
|
||||
+ f64::from(w[2][3])
|
||||
};
|
||||
let focal = f64::from(m.focal);
|
||||
let texel = if m.ortho { 1.0 / focal } else { z.abs() / focal };
|
||||
|
||||
Reference in new issue
Block a user