Modify the fruit example to show any logical vs. physical pixel mismatches

Resize the window to the physical size of the image.
If softbuffer scales the contents incorrectly, only parts
of the fruit basket will be visible.
This commit is contained in:
Simon Hausmann 2022-12-13 14:53:40 +01:00
parent dbd4e796f1
commit fbc48512ef

View file

@ -16,7 +16,10 @@ fn main() {
}).collect::<Vec<_>>();
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();
let window = WindowBuilder::new()
.with_inner_size(winit::dpi::PhysicalSize::new(fruit.width(), fruit.height()))
.build(&event_loop)
.unwrap();
#[cfg(target_arch = "wasm32")]
{