aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-11-18 13:36:49 -0500
committerJosh Matthews <josh@joshmatthews.net>2019-11-19 14:32:31 -0500
commit68b832db27eb5daec452eb340ad97b82eb903a5d (patch)
tree12a5cb98e9a086ae62f90e14c127561cb4231d4a
parente6ae93f66e724bf15e5badccc8d4046e19f04fa8 (diff)
downloadservo-68b832db27eb5daec452eb340ad97b82eb903a5d.tar.gz
servo-68b832db27eb5daec452eb340ad97b82eb903a5d.zip
glutin: Use existing routines for rounding physical/logical sizes.
-rw-r--r--ports/glutin/headed_window.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/glutin/headed_window.rs b/ports/glutin/headed_window.rs
index fad971e3cf5..f8ae49b810d 100644
--- a/ports/glutin/headed_window.rs
+++ b/ports/glutin/headed_window.rs
@@ -540,13 +540,15 @@ impl webxr::glwindow::GlWindow for Window {
fn size(&self) -> UntypedSize2D<gl::GLsizei> {
let dpr = self.device_hidpi_factor().get() as f64;
- let LogicalSize { width, height } = self
+ let size = self
.gl_context
.borrow()
.window()
.get_inner_size()
.expect("Failed to get window inner size.");
- Size2D::new(width * dpr, height *dpr).to_i32()
+ let size = size.to_physical(dpr);
+ let (w, h): (u32, u32) = size.into();
+ Size2D::new(w as i32, h as i32)
}
fn get_rotation(&self) -> Rotation3D<f32, UnknownUnit, UnknownUnit> {