Skip to content

Commit 96c9c60

Browse files
committed
Use cbrt() instead of powf(1./3.) (#6481)
# Objective - Use cube root library function instead of handrolling. ## Solution - Instead of `powf(1./3.)` use `cbrt()`.
1 parent 40ea5b4 commit 96c9c60

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/bevy_ui/src/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ pub fn extract_text_uinodes(
349349
.get(&text_glyph.atlas_info.texture_atlas)
350350
.unwrap();
351351
let texture = atlas.texture.clone_weak();
352-
let index = text_glyph.atlas_info.glyph_index as usize;
352+
let index = text_glyph.atlas_info.glyph_index;
353353
let rect = atlas.textures[index];
354354
let atlas_size = Some(atlas.size);
355355

examples/ecs/iter_combinations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn generate_bodies(
7373
rng.gen_range(-1.0..1.0),
7474
)
7575
.normalize()
76-
* rng.gen_range(0.2f32..1.0).powf(1. / 3.)
76+
* rng.gen_range(0.2f32..1.0).cbrt()
7777
* 15.;
7878

7979
commands.spawn(BodyBundle {

0 commit comments

Comments
 (0)