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 --- widget/src/vertical_slider.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'widget/src/vertical_slider.rs') diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index 47b14d57..91f2b466 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -304,8 +304,7 @@ where match event { Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) | Event::Touch(touch::Event::FingerPressed { .. }) => { - if let Some(cursor_position) = - cursor.position_over(&layout.bounds()) + if let Some(cursor_position) = cursor.position_over(layout.bounds()) { change(cursor_position); state.is_dragging = true; @@ -355,7 +354,7 @@ pub fn draw( R::Theme: StyleSheet, { let bounds = layout.bounds(); - let is_mouse_over = cursor.position_over(&bounds).is_some(); + let is_mouse_over = cursor.is_over(bounds); let style = if state.is_dragging { style_sheet.dragging(style) @@ -445,7 +444,7 @@ pub fn mouse_interaction( state: &State, ) -> mouse::Interaction { let bounds = layout.bounds(); - let is_mouse_over = cursor.position_over(&bounds).is_some(); + let is_mouse_over = cursor.is_over(bounds); if state.is_dragging { mouse::Interaction::Grabbing -- cgit