summaryrefslogtreecommitdiffstats
path: root/wgpu/src/window
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-20 03:56:30 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-20 03:56:30 +0100
commit698b9001b12bfb23fe1eccece62eae6417bea18a (patch)
tree3db828501fedac26342c41fcec05d0e9a7477f0f /wgpu/src/window
parent0fe265adb0a97e64b0c83cbb19c7d0179bb60975 (diff)
parent35e2049ee668791f67b5325fc156b8c042d26d49 (diff)
downloadiced-698b9001b12bfb23fe1eccece62eae6417bea18a.tar.gz
iced-698b9001b12bfb23fe1eccece62eae6417bea18a.tar.bz2
iced-698b9001b12bfb23fe1eccece62eae6417bea18a.zip
Merge pull request #2271 from iced-rs/fix/wasm
Fix WebAssembly platform
Diffstat (limited to 'wgpu/src/window')
-rw-r--r--wgpu/src/window/compositor.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs
index 7ac017d9..0a5d2c8f 100644
--- a/wgpu/src/window/compositor.rs
+++ b/wgpu/src/window/compositor.rs
@@ -257,7 +257,9 @@ impl graphics::Compositor for Compositor {
.create_surface(window)
.expect("Create surface");
- self.configure_surface(&mut surface, width, height);
+ if width > 0 && height > 0 {
+ self.configure_surface(&mut surface, width, height);
+ }
surface
}