Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace std::f32::{EPSILON, MAX} with f32:: as per rust docs recommendation (old way is deprecated) #716

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading