From fd5e77f23e18c131fe2ae20ec3aad10394a7dbc0 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 19 Dec 2014 11:27:03 +1000 Subject: Add missing get_api stubs. Add hidpi_factor() support for retina displays. Fix Resize and MouseMoved events to handle retina displays. Fix inverted y position for MouseMoved events on mac. Fix initial painting on retina display. --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 12a908c..fb551c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -621,6 +621,13 @@ impl Window { pub fn set_cursor(&self, cursor: MouseCursor) { self.window.set_cursor(cursor); } + + /// Returns the ratio between the backing framebuffer resolution and the + /// window size in screen pixels. This is typically one for a normal display + /// and two for a retina display. + pub fn hidpi_factor(&self) -> f32 { + self.window.hidpi_factor() + } } #[cfg(feature = "window")] -- cgit v1.2.3