aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2015-01-19 22:35:34 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2015-01-19 22:35:34 +1100
commita203385e7651a404e49eb72a04a5553d0bbe00b4 (patch)
tree71ff44e1b3a67b71cf2463bb51436647aa9a2c8f
parentb6f3bfa76811db8c249af08066bfb37bb1385165 (diff)
downloadglutin-a203385e7651a404e49eb72a04a5553d0bbe00b4.tar.gz
glutin-a203385e7651a404e49eb72a04a5553d0bbe00b4.zip
if letify
-rw-r--r--src/osx/mod.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/osx/mod.rs b/src/osx/mod.rs
index b338184..c7ce750 100644
--- a/src/osx/mod.rs
+++ b/src/osx/mod.rs
@@ -115,13 +115,10 @@ extern fn window_did_resize(this: id, _: id) -> id {
let _: id = msg_send()(state.context, selector("update"));
- match state.handler {
- Some(handler) => {
- let rect = NSView::frame(state.view);
- 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);
- }
- None => {}
+ if let Some(handler) = state.handler {
+ let rect = NSView::frame(state.view);
+ 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);
}
}
0
@@ -374,7 +371,7 @@ impl Window {
DELEGATE_STATE_IVAR.as_ptr() as *const i8,
ptr::null_mut());
self.is_closed.set(ds.is_closed);
-}
+ }
match event.get_type() {
NSLeftMouseDown => { events.push_back(MouseInput(Pressed, LeftMouseButton)); },