From f80e78bd571fa6cec5f96395278c3bb6f5765f85 Mon Sep 17 00:00:00 2001 From: nashaofu Date: Thu, 11 Jan 2024 22:37:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20windows=20scale=5Ff?= =?UTF-8?q?actor=20=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- src/windows.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3659e72..a1de773 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/windows.rs b/src/windows.rs index 12b4f44..db031c9 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -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 {