1
0
Fork 0

attempt to fix mac build

This commit is contained in:
Billy Messenger 2020-10-20 17:07:37 -05:00
parent 2ee975231b
commit 84cac3e7ba

View file

@ -41,9 +41,22 @@ impl Window {
unsafe { unsafe {
let _pool = NSAutoreleasePool::new(nil); 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( let rect = NSRect::new(
NSPoint::new(0.0, 0.0), 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) 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
}