mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
glutin: Use existing routines for rounding physical/logical sizes.
This commit is contained in:
parent
e6ae93f66e
commit
68b832db27
1 changed files with 4 additions and 2 deletions
|
@ -540,13 +540,15 @@ impl webxr::glwindow::GlWindow for Window {
|
||||||
|
|
||||||
fn size(&self) -> UntypedSize2D<gl::GLsizei> {
|
fn size(&self) -> UntypedSize2D<gl::GLsizei> {
|
||||||
let dpr = self.device_hidpi_factor().get() as f64;
|
let dpr = self.device_hidpi_factor().get() as f64;
|
||||||
let LogicalSize { width, height } = self
|
let size = self
|
||||||
.gl_context
|
.gl_context
|
||||||
.borrow()
|
.borrow()
|
||||||
.window()
|
.window()
|
||||||
.get_inner_size()
|
.get_inner_size()
|
||||||
.expect("Failed to get window 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> {
|
fn get_rotation(&self) -> Rotation3D<f32, UnknownUnit, UnknownUnit> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue