Skip to content

Commit

Permalink
[cpu_shaders][flatten] Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
armansito committed Nov 22, 2023
1 parent 125e67e commit e5c58a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cpu_shader/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ fn flatten_arc(
let n_lines = if theta <= ROBUST_EPSILON {
MAX_LINES
} else {
MAX_LINES.min((6.2831853 / theta).ceil() as u32)
MAX_LINES.min((std::f32::consts::TAU / theta).ceil() as u32)
};

let th = angle / (n_lines as f32);
Expand Down Expand Up @@ -364,7 +364,7 @@ fn draw_cap(
) {
if cap_style == Style::FLAGS_CAP_BITS_ROUND {
flatten_arc(
path_ix, cap0, cap1, point, 3.1415927, transform, line_ix, lines, bbox,
path_ix, cap0, cap1, point, std::f32::consts::PI, transform, line_ix, lines, bbox,
);
return;
}
Expand Down Expand Up @@ -469,7 +469,7 @@ fn read_i16_point(ix: u32, pathdata: &[u32]) -> Vec2 {
let raw = pathdata[ix as usize];
let x = (((raw << 16) as i32) >> 16) as f32;
let y = ((raw as i32) >> 16) as f32;
return Vec2::new(x, y);
Vec2 { x, y }
}

#[derive(Debug)]
Expand Down

0 comments on commit e5c58a3

Please sign in to comment.