attempt to fix mac build
This commit is contained in:
parent
2ee975231b
commit
84cac3e7ba
|
@ -41,9 +41,22 @@ impl Window {
|
|||
unsafe {
|
||||
let _pool = NSAutoreleasePool::new(nil);
|
||||
|
||||
let scaling = match options.scale {
|
||||
// TODO: Find system scale factor
|
||||
WindowScalePolicy::TrySystemScaleFactor => get_scaling().unwrap_or(1.0),
|
||||
WindowScalePolicy::TrySystemScaleFactorTimes(user_scale) => get_scaling().unwrap_or(1.0) * user_scale,
|
||||
WindowScalePolicy::UseScaleFactor(user_scale) => user_scale,
|
||||
WindowScalePolicy::NoScaling => 1.0,
|
||||
};
|
||||
|
||||
let window_info = options.window_info_from_scale(scaling);
|
||||
|
||||
let rect = NSRect::new(
|
||||
NSPoint::new(0.0, 0.0),
|
||||
NSSize::new(options.width as f64, options.height as f64),
|
||||
NSSize::new(
|
||||
window_info.logical_size().width as f64,
|
||||
window_info.logical_size().height as f64
|
||||
),
|
||||
);
|
||||
|
||||
let ns_window = NSWindow::alloc(nil)
|
||||
|
@ -83,3 +96,8 @@ unsafe impl HasRawWindowHandle for Window {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn get_scaling() -> Option<f64> {
|
||||
// TODO: find system scaling
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue