summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-09-26 16:02:27 +0200
committerLibravatar GitHub <noreply@github.com>2022-09-26 16:02:27 +0200
commit4aea743999dfcbffec73d84d9afd73fd5a7c3769 (patch)
tree715d1bb029fc6e2125c47036ea0ea4b05995f9e1
parent3c2a8b70add7139bf564313da4d2267138ae65aa (diff)
parent0412718080a17cc3d4f505677b4bd08a278d976a (diff)
downloadiced-4aea743999dfcbffec73d84d9afd73fd5a7c3769.tar.gz
iced-4aea743999dfcbffec73d84d9afd73fd5a7c3769.tar.bz2
iced-4aea743999dfcbffec73d84d9afd73fd5a7c3769.zip
Merge pull request #1139 from thenlevy/fix_wgpu_integration
Fix wgpu integration example
Diffstat (limited to '')
-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 {