Document rounding the screen size to account for non-integer HiDPI scaling factors

This commit is contained in:
Jay Oster 2019-10-27 20:36:49 -07:00
parent 4bbf9770bc
commit 109d115997

View file

@ -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>(())