utils: overlap support on-the-fly rect conversion
This commit is contained in:
parent
ee5c14e673
commit
1a7027eefc
|
@ -817,7 +817,8 @@ impl<N: Coordinate, Kind> Rectangle<N, Kind> {
|
||||||
|
|
||||||
/// Checks whether a given [`Rectangle`] overlaps with this one
|
/// Checks whether a given [`Rectangle`] overlaps with this one
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn overlaps(self, other: Rectangle<N, Kind>) -> bool {
|
pub fn overlaps(self, other: impl Into<Rectangle<N, Kind>>) -> bool {
|
||||||
|
let other = other.into();
|
||||||
// if the rectangle is not outside of the other
|
// if the rectangle is not outside of the other
|
||||||
// they must overlap
|
// they must overlap
|
||||||
!(
|
!(
|
||||||
|
|
Loading…
Reference in New Issue