if letify

This commit is contained in:
Brendan Zabarauskas 2015-01-19 22:35:34 +11:00
parent b6f3bfa768
commit a203385e76

View file

@ -115,14 +115,11 @@ 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
} }