From 5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 8 Jun 2023 20:16:46 +0200 Subject: Take `Rectangle` by value in `Cursor` API --- core/src/mouse/cursor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/src/mouse') diff --git a/core/src/mouse/cursor.rs b/core/src/mouse/cursor.rs index d4cb415d..223ed96d 100644 --- a/core/src/mouse/cursor.rs +++ b/core/src/mouse/cursor.rs @@ -24,7 +24,7 @@ impl Cursor { /// /// If the [`Cursor`] is not over the provided bounds, this method will /// return `None`. - pub fn position_over(self, bounds: &Rectangle) -> Option { + pub fn position_over(self, bounds: Rectangle) -> Option { self.position().filter(|p| bounds.contains(*p)) } @@ -33,7 +33,7 @@ impl Cursor { /// /// If the [`Cursor`] is not over the provided bounds, this method will /// return `None`. - pub fn position_in(self, bounds: &Rectangle) -> Option { + pub fn position_in(self, bounds: Rectangle) -> Option { self.position_over(bounds) .map(|p| p - Vector::new(bounds.x, bounds.y)) } @@ -45,7 +45,7 @@ impl Cursor { } /// Returns true if the [`Cursor`] is over the given `bounds`. - pub fn is_over(self, bounds: &Rectangle) -> bool { + pub fn is_over(self, bounds: Rectangle) -> bool { self.position_over(bounds).is_some() } } -- cgit