diff options
author | 2023-06-08 20:16:46 +0200 | |
---|---|---|
committer | 2023-06-08 20:16:46 +0200 | |
commit | 5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28 (patch) | |
tree | b4f6ae33729d3ddc0d8c529a54f401fec305f00a /examples/bezier_tool | |
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 'examples/bezier_tool')
-rw-r--r-- | examples/bezier_tool/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs index b4568cbf..310be28f 100644 --- a/examples/bezier_tool/src/main.rs +++ b/examples/bezier_tool/src/main.rs @@ -101,7 +101,7 @@ mod bezier { cursor: mouse::Cursor, ) -> (event::Status, Option<Curve>) { let cursor_position = - if let Some(position) = cursor.position_in(&bounds) { + if let Some(position) = cursor.position_in(bounds) { position } else { return (event::Status::Ignored, None); @@ -183,7 +183,7 @@ mod bezier { bounds: Rectangle, cursor: mouse::Cursor, ) -> mouse::Interaction { - if cursor.is_over(&bounds) { + if cursor.is_over(bounds) { mouse::Interaction::Crosshair } else { mouse::Interaction::default() @@ -226,7 +226,7 @@ mod bezier { ) -> Geometry { let mut frame = Frame::new(renderer, bounds.size()); - if let Some(cursor_position) = cursor.position_in(&bounds) { + if let Some(cursor_position) = cursor.position_in(bounds) { match *self { Pending::One { from } => { let line = Path::line(from, cursor_position); |