diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2025-07-03 15:09:19 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2025-07-03 15:09:19 +1200 |
commit | 70d26c2744058cfc922527ef994126c6c840848b (patch) | |
tree | 8ec5f027b9b764e683fcf7b564189d10f0dee070 /src/window.rs | |
parent | 9bb58a8557f5000489769e839dbab03d6f71c777 (diff) | |
download | phosphor-70d26c2744058cfc922527ef994126c6c840848b.zip |
Tidy event code and add support for hover events
Diffstat (limited to 'src/window.rs')
-rw-r--r-- | src/window.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/window.rs b/src/window.rs index 8d118fa..7403edb 100644 --- a/src/window.rs +++ b/src/window.rs @@ -10,6 +10,7 @@ use winit::window::{CursorIcon, Fullscreen, Window}; use std::rc::Rc; use std::cmp::{min, max}; + fn to_physical_size(dimensions: Dimensions, scale: u32) -> PhysicalSize<u32> { PhysicalSize { width: max(1, dimensions.width * scale), @@ -20,9 +21,9 @@ fn to_physical_size(dimensions: Dimensions, scale: u32) -> PhysicalSize<u32> { #[derive(Copy, Clone, Debug, PartialEq)] pub enum PointerState { - In, - Out, - PendingOut, + In, // pointer is within the screen bounds + Out, // pointer is outside the screen bounds + PendingOut, // pointer is dragging outside the screen bounds } |