From 1a7027eefc14d4bb50c58fddfd4d48de6deac580 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Thu, 16 Dec 2021 16:54:32 +0100 Subject: [PATCH] utils: overlap support on-the-fly rect conversion --- src/utils/geometry.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/geometry.rs b/src/utils/geometry.rs index d96bb7e..603007d 100644 --- a/src/utils/geometry.rs +++ b/src/utils/geometry.rs @@ -817,7 +817,8 @@ impl Rectangle { /// Checks whether a given [`Rectangle`] overlaps with this one #[inline] - pub fn overlaps(self, other: Rectangle) -> bool { + pub fn overlaps(self, other: impl Into>) -> bool { + let other = other.into(); // if the rectangle is not outside of the other // they must overlap !(