forked from M-Labs/nalgebra
For matrices, return the actual result of partial_clamp instead of None.
Fix #401
This commit is contained in:
parent
962e89417c
commit
c6bc62c95f
@ -909,7 +909,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
first_ord
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -706,6 +706,16 @@ fn set_row_column() {
|
|||||||
assert_eq!(expected2, computed);
|
assert_eq!(expected2, computed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn partial_clamp() {
|
||||||
|
// NOTE: from #401.
|
||||||
|
let n = Vector2::new(1.5, 0.0);
|
||||||
|
let min = Vector2::new(-75.0, -0.0);
|
||||||
|
let max = Vector2::new(75.0, 0.0);
|
||||||
|
let inter = na::partial_clamp(&n, &min, &max);
|
||||||
|
assert_eq!(*inter.unwrap(), n);
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
mod transposition_tests {
|
mod transposition_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
Loading…
Reference in New Issue
Block a user