mac scale factor of each screen (#8368)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-06-16 12:01:41 +08:00
committed by GitHub
Unverified
parent 12ff1319f1
commit 60ea8d2c2b
3 changed files with 9 additions and 5 deletions

View File

@@ -71,7 +71,7 @@ impl Display {
}
pub fn scale(self) -> f64 {
let s = unsafe { BackingScaleFactor() as _ };
let s = unsafe { BackingScaleFactor(self.0) as _ };
if s > 1. {
let enable_retina = super::ENABLE_RETINA.lock().unwrap().clone();
if enable_retina {

View File

@@ -193,7 +193,7 @@ extern "C" {
pub fn CGDisplayIsOnline(display: u32) -> i32;
pub fn CGDisplayBounds(display: u32) -> CGRect;
pub fn BackingScaleFactor() -> f32;
pub fn BackingScaleFactor(display: u32) -> f32;
// IOSurface