utils: overlap support on-the-fly rect conversion

This commit is contained in:
Victor Brekenfeld 2021-12-16 16:54:32 +01:00
parent ee5c14e673
commit 1a7027eefc
1 changed files with 2 additions and 1 deletions

View File

@ -817,7 +817,8 @@ impl<N: Coordinate, Kind> Rectangle<N, Kind> {
/// Checks whether a given [`Rectangle`] overlaps with this one
#[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
// they must overlap
!(