From 109d115997949f15a90ad0ac5584d33c65b82c22 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 27 Oct 2019 20:36:49 -0700 Subject: [PATCH] Document rounding the screen size to account for non-integer HiDPI scaling factors --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1d89cc6..ec6811d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,8 +94,8 @@ impl SurfaceTexture { /// let surface = Surface::create(&window); /// let size = window.inner_size().to_physical(window.hidpi_factor()); /// - /// let width = size.width as u32; - /// let height = size.height as u32; + /// let width = size.width.round() as u32; + /// let height = size.height.round() as u32; /// /// let surface_texture = SurfaceTexture::new(width, height, surface); /// # Ok::<(), pixels::Error>(())