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:
parent
dbd4e796f1
commit
fbc48512ef
1 changed files with 4 additions and 1 deletions
|
|
@ -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")]
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue