Remove Option from HiDpiFactorChanged in favor of a bare PhysicalSize (#1346)
* Remove Option from HiDpiFactorChanged in favor of a bare PhysicalSize * Fix macos and ios builds
This commit is contained in:
parent
777d9edeaa
commit
55166da437
6 changed files with 40 additions and 41 deletions
|
|
@ -188,8 +188,8 @@ impl Handler {
|
|||
suggested_size: LogicalSize<f64>,
|
||||
hidpi_factor: f64,
|
||||
) {
|
||||
let size = suggested_size.to_physical(hidpi_factor);
|
||||
let new_inner_size = &mut Some(size);
|
||||
let mut size = suggested_size.to_physical(hidpi_factor);
|
||||
let new_inner_size = &mut size;
|
||||
let event = Event::WindowEvent {
|
||||
window_id: WindowId(get_window_id(*ns_window)),
|
||||
event: WindowEvent::HiDpiFactorChanged {
|
||||
|
|
@ -200,7 +200,7 @@ impl Handler {
|
|||
|
||||
callback.handle_nonuser_event(event, &mut *self.control_flow.lock().unwrap());
|
||||
|
||||
let physical_size = new_inner_size.unwrap_or(size);
|
||||
let physical_size = *new_inner_size;
|
||||
let logical_size = physical_size.to_logical(hidpi_factor);
|
||||
let size = NSSize::new(logical_size.width, logical_size.height);
|
||||
unsafe { NSWindow::setContentSize_(*ns_window, size) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue