Skip to content

Commit

Permalink
Merge pull request #2551 from airstrike/mouse-interactions
Browse files Browse the repository at this point in the history
Expose additional mouse interaction cursors
  • Loading branch information
hecrj authored Sep 13, 2024
2 parents 69dc81d + d4b9b47 commit e9e8e83
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/mouse/interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ pub enum Interaction {
Grabbing,
ResizingHorizontally,
ResizingVertically,
ResizingDiagonallyUp,
ResizingDiagonallyDown,
NotAllowed,
ZoomIn,
ZoomOut,
Cell,
Move,
Copy,
Help,
}
11 changes: 11 additions & 0 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,19 @@ pub fn mouse_interaction(
winit::window::CursorIcon::EwResize
}
Interaction::ResizingVertically => winit::window::CursorIcon::NsResize,
Interaction::ResizingDiagonallyUp => {
winit::window::CursorIcon::NeswResize
}
Interaction::ResizingDiagonallyDown => {
winit::window::CursorIcon::NwseResize
}
Interaction::NotAllowed => winit::window::CursorIcon::NotAllowed,
Interaction::ZoomIn => winit::window::CursorIcon::ZoomIn,
Interaction::ZoomOut => winit::window::CursorIcon::ZoomOut,
Interaction::Cell => winit::window::CursorIcon::Cell,
Interaction::Move => winit::window::CursorIcon::Move,
Interaction::Copy => winit::window::CursorIcon::Copy,
Interaction::Help => winit::window::CursorIcon::Help,
}
}

Expand Down

0 comments on commit e9e8e83

Please sign in to comment.