From 4ca291f06f612cb83f4955292d794c7b406fbca6 Mon Sep 17 00:00:00 2001 From: targrub Date: Sat, 5 Nov 2022 09:13:01 -0400 Subject: [PATCH 1/2] Use cbrt() instead of powf(1./3.). --- examples/ecs/iter_combinations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ecs/iter_combinations.rs b/examples/ecs/iter_combinations.rs index cfb0812b1282f..fa0ab75419866 100644 --- a/examples/ecs/iter_combinations.rs +++ b/examples/ecs/iter_combinations.rs @@ -73,7 +73,7 @@ fn generate_bodies( rng.gen_range(-1.0..1.0), ) .normalize() - * rng.gen_range(0.2f32..1.0).powf(1. / 3.) + * rng.gen_range(0.2f32..1.0).cbrt() * 15.; commands.spawn(BodyBundle { From 640af376e6d0c7c1c747327a05e9672877e2c3e8 Mon Sep 17 00:00:00 2001 From: targrub Date: Sat, 5 Nov 2022 09:16:25 -0400 Subject: [PATCH 2/2] Removed unnecessary "`as usize`". --- crates/bevy_ui/src/render/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index f7484fe76fc16..988364a0a8189 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -349,7 +349,7 @@ pub fn extract_text_uinodes( .get(&text_glyph.atlas_info.texture_atlas) .unwrap(); let texture = atlas.texture.clone_weak(); - let index = text_glyph.atlas_info.glyph_index as usize; + let index = text_glyph.atlas_info.glyph_index; let rect = atlas.textures[index]; let atlas_size = Some(atlas.size);