Skip to content

Commit fbc4851

Browse files
committed
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.
1 parent dbd4e79 commit fbc4851

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/fruit.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ fn main() {
1616
}).collect::<Vec<_>>();
1717

1818
let event_loop = EventLoop::new();
19-
let window = WindowBuilder::new().build(&event_loop).unwrap();
19+
let window = WindowBuilder::new()
20+
.with_inner_size(winit::dpi::PhysicalSize::new(fruit.width(), fruit.height()))
21+
.build(&event_loop)
22+
.unwrap();
2023

2124
#[cfg(target_arch = "wasm32")]
2225
{

0 commit comments

Comments
 (0)