Skip to content

Commit

Permalink
Propagate mouse cursor movements in stack
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 1, 2025
1 parent 2fc94d9 commit 7a6d4d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion widget/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ where
viewport: &Rectangle,
) {
let is_over = cursor.is_over(layout.bounds());
let is_mouse_movement =
matches!(event, Event::Mouse(mouse::Event::CursorMoved { .. }));

for ((child, state), layout) in self
.children
Expand All @@ -235,7 +237,10 @@ where
viewport,
);

if is_over && cursor != mouse::Cursor::Unavailable {
if is_over
&& !is_mouse_movement
&& cursor != mouse::Cursor::Unavailable
{
let interaction = child.as_widget().mouse_interaction(
state, layout, cursor, viewport, renderer,
);
Expand Down

0 comments on commit 7a6d4d5

Please sign in to comment.