Take Rectangle by value in Cursor API
This commit is contained in:
parent
34451bff18
commit
5c8cfb411e
21 changed files with 57 additions and 62 deletions
|
|
@ -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<T, R>(
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue