From 70d26c2744058cfc922527ef994126c6c840848b Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Thu, 3 Jul 2025 15:09:19 +1200 Subject: Tidy event code and add support for hover events --- src/window.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/window.rs') 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 { PhysicalSize { width: max(1, dimensions.width * scale), @@ -20,9 +21,9 @@ fn to_physical_size(dimensions: Dimensions, scale: u32) -> PhysicalSize { #[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 } -- cgit v1.2.3-70-g09d2