mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
fix clippy warning for clamp pattern in webgl_thread
(#33230)
Signed-off-by: Callum Leslie <git@cleslie.uk>
This commit is contained in:
parent
7c4ba51f51
commit
87f437d230
1 changed files with 2 additions and 2 deletions
|
@ -1046,7 +1046,7 @@ impl WebGLImpl {
|
||||||
gl.clear_color(r, g, b, a);
|
gl.clear_color(r, g, b, a);
|
||||||
},
|
},
|
||||||
WebGLCommand::ClearDepth(depth) => {
|
WebGLCommand::ClearDepth(depth) => {
|
||||||
let value = depth.max(0.).min(1.) as f64;
|
let value = depth.clamp(0., 1.) as f64;
|
||||||
state.depth_clear_value = value;
|
state.depth_clear_value = value;
|
||||||
gl.clear_depth(value)
|
gl.clear_depth(value)
|
||||||
},
|
},
|
||||||
|
@ -1085,7 +1085,7 @@ impl WebGLImpl {
|
||||||
state.restore_depth_invariant(gl);
|
state.restore_depth_invariant(gl);
|
||||||
},
|
},
|
||||||
WebGLCommand::DepthRange(near, far) => {
|
WebGLCommand::DepthRange(near, far) => {
|
||||||
gl.depth_range(near.max(0.).min(1.) as f64, far.max(0.).min(1.) as f64)
|
gl.depth_range(near.clamp(0., 1.) as f64, far.clamp(0., 1.) as f64)
|
||||||
},
|
},
|
||||||
WebGLCommand::Disable(cap) => match cap {
|
WebGLCommand::Disable(cap) => match cap {
|
||||||
gl::SCISSOR_TEST => {
|
gl::SCISSOR_TEST => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue