summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-20 02:51:20 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-20 02:51:20 +0100
commit8a86ef14e3c178343226312ec53b677cfad6fa12 (patch)
tree7b04d468c668789213d32c6e457748911c960b60 /wgpu
parentff011e5dfd54bfa1fa566e511977d6a180f6262a (diff)
downloadiced-8a86ef14e3c178343226312ec53b677cfad6fa12.tar.gz
iced-8a86ef14e3c178343226312ec53b677cfad6fa12.tar.bz2
iced-8a86ef14e3c178343226312ec53b677cfad6fa12.zip
Avoid uninitialized `Surface` configuration on Wasm
Diffstat (limited to 'wgpu')
-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
}