From 0a1e0f98c6b9fbe955fffabbc2308b30c1d0e27f Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sun, 9 Feb 2025 09:31:25 -0500 Subject: [PATCH] Scale based on minimum dimension to fit the frame --- crates/flare-shader/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/flare-shader/src/lib.rs b/crates/flare-shader/src/lib.rs index ed31d83..95e1bb0 100644 --- a/crates/flare-shader/src/lib.rs +++ b/crates/flare-shader/src/lib.rs @@ -257,12 +257,12 @@ pub fn main_cs( point = next_transform(&mut rng, transform_weight, transforms).apply(variations, point); } - // ...because `.max()` has compilation issues. - let max_dimension = if image_constants.accum_width > image_constants.accum_height { image_constants.accum_width } else { image_constants.accum_height }; + // ...because `.min()` has compilation issues. + let min_dimension = if image_constants.accum_width < image_constants.accum_height { image_constants.accum_width } else { image_constants.accum_height }; // Fixed camera, should be provided by a uniform in the future let camera = CameraConstants { - scale: max_dimension as f32 / 4.0, + scale: min_dimension as f32 / 4.0, zoom: 2.0, rotate: 0.0, offset_x: 0.5,