From 879c6af8562bc446cebbfdce7052ab9aeb61ee5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lynn=20B=C3=BCttgenbach?= <62256001+lynn-lumen@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:31:25 +0200 Subject: [PATCH] Allow "on edge" interior sampling --- crates/bevy_math/src/sampling/shape_sampling.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_math/src/sampling/shape_sampling.rs b/crates/bevy_math/src/sampling/shape_sampling.rs index 348333ef70..4b245eb8ff 100644 --- a/crates/bevy_math/src/sampling/shape_sampling.rs +++ b/crates/bevy_math/src/sampling/shape_sampling.rs @@ -228,8 +228,8 @@ impl ShapeSample for Rhombus { type Output = Vec2; fn sample_interior(&self, rng: &mut R) -> Vec2 { - let x: f32 = rng.gen_range(0.0..1.0); - let y: f32 = rng.gen_range(0.0..1.0); + let x: f32 = rng.gen_range(0.0..=1.0); + let y: f32 = rng.gen_range(0.0..=1.0); let unit_p = Vec2::NEG_X + x * Vec2::ONE + Vec2::new(y, -y); unit_p * self.half_diagonals