Document rounding the screen size to account for non-integer HiDPI scaling factors
This commit is contained in:
parent
4bbf9770bc
commit
109d115997
|
@ -94,8 +94,8 @@ impl SurfaceTexture {
|
||||||
/// let surface = Surface::create(&window);
|
/// let surface = Surface::create(&window);
|
||||||
/// let size = window.inner_size().to_physical(window.hidpi_factor());
|
/// let size = window.inner_size().to_physical(window.hidpi_factor());
|
||||||
///
|
///
|
||||||
/// let width = size.width as u32;
|
/// let width = size.width.round() as u32;
|
||||||
/// let height = size.height as u32;
|
/// let height = size.height.round() as u32;
|
||||||
///
|
///
|
||||||
/// let surface_texture = SurfaceTexture::new(width, height, surface);
|
/// let surface_texture = SurfaceTexture::new(width, height, surface);
|
||||||
/// # Ok::<(), pixels::Error>(())
|
/// # Ok::<(), pixels::Error>(())
|
||||||
|
|
Loading…
Reference in a new issue