diff options
author | 2023-06-08 20:16:46 +0200 | |
---|---|---|
committer | 2023-06-08 20:16:46 +0200 | |
commit | 5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28 (patch) | |
tree | b4f6ae33729d3ddc0d8c529a54f401fec305f00a /core/src/mouse | |
parent | 34451bff185d8875f55747ee97ed746828e30f40 (diff) | |
download | iced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.tar.gz iced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.tar.bz2 iced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.zip |
Take `Rectangle` by value in `Cursor` API
Diffstat (limited to 'core/src/mouse')
-rw-r--r-- | core/src/mouse/cursor.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Point> { + pub fn position_over(self, bounds: Rectangle) -> Option<Point> { 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<Point> { + pub fn position_in(self, bounds: Rectangle) -> Option<Point> { 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() } } |