feat: add window::Event::ScaleFactorChanged

This commit is contained in:
csmoe 2025-06-25 12:42:54 +08:00 committed by Héctor Ramón Jiménez
parent 19569f7900
commit 21cf7f98d7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 6 additions and 0 deletions

View file

@ -71,4 +71,7 @@ pub enum Event {
///
/// - **Wayland:** Not implemented.
FilesHoveredLeft,
/// A window's scale factor was changed.
ScaleFactorChanged(f64),
}

View file

@ -331,6 +331,9 @@ pub fn window_event(
Some(Event::Window(window::Event::Moved(Point::new(x, y))))
}
WindowEvent::ScaleFactorChanged { scale_factor, .. } => Some(
Event::Window(window::Event::ScaleFactorChanged(scale_factor)),
),
_ => None,
}
}