summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/integration_wgpu/src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs
index 86a0d6a4..69d46c3e 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration_wgpu/src/main.rs
@@ -157,12 +157,7 @@ pub fn main() {
WindowEvent::ModifiersChanged(new_modifiers) => {
modifiers = new_modifiers;
}
- WindowEvent::Resized(new_size) => {
- viewport = Viewport::with_physical_size(
- Size::new(new_size.width, new_size.height),
- window.scale_factor(),
- );
-
+ WindowEvent::Resized(_) => {
resized = true;
}
WindowEvent::CloseRequested => {
@@ -205,6 +200,11 @@ pub fn main() {
if resized {
let size = window.inner_size();
+ viewport = Viewport::with_physical_size(
+ Size::new(size.width, size.height),
+ window.scale_factor(),
+ );
+
surface.configure(
&device,
&wgpu::SurfaceConfiguration {