Skip to content

Commit

Permalink
fix: 修复 windows scale_factor 错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nashaofu committed Jan 11, 2024
1 parent 0f6aca4 commit f80e78b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "display-info"
version = "0.4.6"
version = "0.4.8"
edition = "2021"
description = "Cross-platform get display info"
license-file = "LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn get_scale_factor(sz_device: *const u16) -> f32 {
let logical_width = unsafe { GetDeviceCaps(*dcw_drop_box, HORZRES) };
let physical_width = unsafe { GetDeviceCaps(*dcw_drop_box, DESKTOPHORZRES) };

logical_width as f32 / physical_width as f32
physical_width as f32 / logical_width as f32
}

fn get_monitor_info_exw(h_monitor: HMONITOR) -> Result<MONITORINFOEXW> {
Expand Down

0 comments on commit f80e78b

Please sign in to comment.