summaryrefslogtreecommitdiffstats
path: root/widget/src/slider.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-08 20:16:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-08 20:16:46 +0200
commit5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28 (patch)
treeb4f6ae33729d3ddc0d8c529a54f401fec305f00a /widget/src/slider.rs
parent34451bff185d8875f55747ee97ed746828e30f40 (diff)
downloadiced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.tar.gz
iced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.tar.bz2
iced-5c8cfb411ed0a9a6e55bd1193cd7e97252e63d28.zip
Take `Rectangle` by value in `Cursor` API
Diffstat (limited to 'widget/src/slider.rs')
-rw-r--r--widget/src/slider.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/widget/src/slider.rs b/widget/src/slider.rs
index 4f35805c..3ea4391b 100644
--- a/widget/src/slider.rs
+++ b/widget/src/slider.rs
@@ -305,8 +305,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;
@@ -356,7 +355,7 @@ pub fn draw<T, R>(
R::Theme: StyleSheet,
{
let bounds = layout.bounds();
- let is_mouse_over = cursor.is_over(&bounds);
+ let is_mouse_over = cursor.is_over(bounds);
let style = if state.is_dragging {
style_sheet.dragging(style)
@@ -446,7 +445,7 @@ pub fn mouse_interaction(
state: &State,
) -> mouse::Interaction {
let bounds = layout.bounds();
- let is_mouse_over = cursor.is_over(&bounds);
+ let is_mouse_over = cursor.is_over(bounds);
if state.is_dragging {
mouse::Interaction::Grabbing