Skip to content

Commit

Permalink
replace std::f32::{EPSILON, MAX} with f32:: as per rust docs recommen…
Browse files Browse the repository at this point in the history
…dation (old way is deprecated)
  • Loading branch information
zero authored and not-fl3 committed Apr 17, 2024
1 parent f451960 commit 6be980e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pub fn draw_line(x1: f32, y1: f32, x2: f32, y2: f32, thickness: f32, color: Colo
let ny = dx;

let tlen = (nx * nx + ny * ny).sqrt() / (thickness * 0.5);
if tlen < std::f32::EPSILON {
if tlen < f32::EPSILON {
return;
}
let tx = nx / tlen;
Expand Down
4 changes: 2 additions & 2 deletions src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ impl Font {
}

let mut width = 0.;
let mut min_y = std::f32::MAX;
let mut max_y = -std::f32::MAX;
let mut min_y = f32::MAX;
let mut max_y = -f32::MAX;

let atlas = self.atlas.lock().unwrap();

Expand Down
2 changes: 1 addition & 1 deletion src/ui/render/mesh_rasterizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl DrawList {
let ny = dx;

let tlen = (nx * nx + ny * ny).sqrt() / (thickness * 0.5);
if tlen < std::f32::EPSILON {
if tlen < f32::EPSILON {
return;
}
let tx = nx / tlen;
Expand Down

0 comments on commit 6be980e

Please sign in to comment.