From 68b832db27eb5daec452eb340ad97b82eb903a5d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 18 Nov 2019 13:36:49 -0500 Subject: [PATCH] glutin: Use existing routines for rounding physical/logical sizes. --- ports/glutin/headed_window.rs | 6 ++++-- 1 file 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 { 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 {