Skip to content

Commit

Permalink
feat(Window): expose screen_dpi_scale()
Browse files Browse the repository at this point in the history
  • Loading branch information
miwarnec authored and not-fl3 committed Apr 1, 2024
1 parent 90f4335 commit ce5347b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ pub fn screen_height() -> f32 {
context.screen_height / miniquad::window::dpi_scale()
}

pub fn screen_dpi_scale() -> f32 {
miniquad::window::dpi_scale()
}

/// Request the window size to be the given value. This takes DPI into account.
///
/// Note that the OS might decide to give a different size. Additionally, the size in macroquad won't be updated until the next `next_frame().await`.
Expand Down

0 comments on commit ce5347b

Please sign in to comment.