mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
if letify
This commit is contained in:
parent
b6f3bfa768
commit
a203385e76
|
@ -115,13 +115,10 @@ extern fn window_did_resize(this: id, _: id) -> id {
|
||||||
|
|
||||||
let _: id = msg_send()(state.context, selector("update"));
|
let _: id = msg_send()(state.context, selector("update"));
|
||||||
|
|
||||||
match state.handler {
|
if let Some(handler) = state.handler {
|
||||||
Some(handler) => {
|
let rect = NSView::frame(state.view);
|
||||||
let rect = NSView::frame(state.view);
|
let scale_factor = state.window.backingScaleFactor() as f32;
|
||||||
let scale_factor = state.window.backingScaleFactor() as f32;
|
(handler)((scale_factor * rect.size.width as f32) as u32, (scale_factor * rect.size.height as f32) as u32);
|
||||||
(handler)((scale_factor * rect.size.width as f32) as u32, (scale_factor * rect.size.height as f32) as u32);
|
|
||||||
}
|
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
0
|
0
|
||||||
|
@ -374,7 +371,7 @@ impl Window {
|
||||||
DELEGATE_STATE_IVAR.as_ptr() as *const i8,
|
DELEGATE_STATE_IVAR.as_ptr() as *const i8,
|
||||||
ptr::null_mut());
|
ptr::null_mut());
|
||||||
self.is_closed.set(ds.is_closed);
|
self.is_closed.set(ds.is_closed);
|
||||||
}
|
}
|
||||||
|
|
||||||
match event.get_type() {
|
match event.get_type() {
|
||||||
NSLeftMouseDown => { events.push_back(MouseInput(Pressed, LeftMouseButton)); },
|
NSLeftMouseDown => { events.push_back(MouseInput(Pressed, LeftMouseButton)); },
|
||||||
|
|
Loading…
Reference in a new issue