diff options
author | 2023-06-08 20:16:46 +0200 | |
---|---|---|
committer | 2023-06-08 20:16:46 +0200 | |
commit | 5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28 (patch) | |
tree | b4f6ae33729d3ddc0d8c529a54f401fec305f00a /widget/src/button.rs | |
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 'widget/src/button.rs')
-rw-r--r-- | widget/src/button.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/widget/src/button.rs b/widget/src/button.rs index 89af341c..0f3cbde2 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -311,7 +311,7 @@ pub fn update<'a, Message: Clone>( if on_press.is_some() { let bounds = layout.bounds(); - if cursor.is_over(&bounds) { + if cursor.is_over(bounds) { let state = state(); state.is_pressed = true; @@ -330,7 +330,7 @@ pub fn update<'a, Message: Clone>( let bounds = layout.bounds(); - if cursor.is_over(&bounds) { + if cursor.is_over(bounds) { shell.publish(on_press); } @@ -364,7 +364,7 @@ pub fn draw<'a, Renderer: crate::core::Renderer>( where Renderer::Theme: StyleSheet, { - let is_mouse_over = cursor.is_over(&bounds); + let is_mouse_over = cursor.is_over(bounds); let styling = if !is_enabled { style_sheet.disabled(style) @@ -440,7 +440,7 @@ pub fn mouse_interaction( cursor: mouse::Cursor, is_enabled: bool, ) -> mouse::Interaction { - let is_mouse_over = cursor.is_over(&layout.bounds()); + let is_mouse_over = cursor.is_over(layout.bounds()); if is_mouse_over && is_enabled { mouse::Interaction::Pointer |