diff --git a/components/util/geometry.rs b/components/util/geometry.rs index 224f301141d..c2f08f7cd8d 100644 --- a/components/util/geometry.rs +++ b/components/util/geometry.rs @@ -89,7 +89,9 @@ pub static MAX_RECT: Rect = Rect { /// Returns true if the rect contains the given point. Points on the top or left sides of the rect /// are considered inside the rectangle, while points on the right or bottom sides of the rect are /// not considered inside the rectangle. -pub fn rect_contains_point>(rect: Rect, point: Point2D) -> bool { +pub fn rect_contains_point(rect: Rect, point: Point2D) -> bool + where T: PartialOrd + Add +{ point.x >= rect.origin.x && point.x < rect.origin.x + rect.size.width && point.y >= rect.origin.y && point.y < rect.origin.y + rect.size.height }