parent
62795909d8
commit
01429d72cd
3 changed files with 36 additions and 37 deletions
|
|
@ -363,7 +363,11 @@ where
|
|||
Event::Mouse(mouse::Event::CursorMoved { .. })
|
||||
| Event::Touch(touch::Event::FingerMoved { .. }) => {
|
||||
if state.is_dragging {
|
||||
let _ = cursor.position().and_then(locate).map(change);
|
||||
let _ = cursor
|
||||
.land()
|
||||
.position()
|
||||
.and_then(locate)
|
||||
.map(change);
|
||||
|
||||
shell.capture_event();
|
||||
}
|
||||
|
|
@ -527,12 +531,10 @@ where
|
|||
_renderer: &Renderer,
|
||||
) -> mouse::Interaction {
|
||||
let state = tree.state.downcast_ref::<State>();
|
||||
let bounds = layout.bounds();
|
||||
let is_mouse_over = cursor.is_over(bounds);
|
||||
|
||||
if state.is_dragging {
|
||||
mouse::Interaction::Grabbing
|
||||
} else if is_mouse_over {
|
||||
} else if cursor.is_over(layout.bounds()) {
|
||||
mouse::Interaction::Grab
|
||||
} else {
|
||||
mouse::Interaction::default()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue