diff options
author | 2023-08-02 22:26:11 +0200 | |
---|---|---|
committer | 2023-08-02 22:26:11 +0200 | |
commit | f7ca420817a2d3f892534bc7bd21f74ed77132e2 (patch) | |
tree | 7ca3a6fa9178ee889804d1106a026c0b7ff08c34 /wgpu | |
parent | 50ce65b3b7ad10a8537b751b3890d9dcfaecf846 (diff) | |
parent | 4dfa2f0abf9c8219d9f04980e9e5959d1a93b555 (diff) | |
download | iced-f7ca420817a2d3f892534bc7bd21f74ed77132e2.tar.gz iced-f7ca420817a2d3f892534bc7bd21f74ed77132e2.tar.bz2 iced-f7ca420817a2d3f892534bc7bd21f74ed77132e2.zip |
Merge pull request #1996 from iced-rs/fix/wgpu-freeze
Fix `iced_wgpu` freezing on empty layers
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/backend.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index 9966a38c..68d1f805 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -87,7 +87,10 @@ impl Backend { let transformation = viewport.projection(); let mut layers = Layer::generate(primitives, viewport); - layers.push(Layer::overlay(overlay_text, viewport)); + + if !overlay_text.is_empty() { + layers.push(Layer::overlay(overlay_text, viewport)); + } self.prepare( device, @@ -236,7 +239,7 @@ impl Backend { let bounds = (layer.bounds * scale_factor).snap(); if bounds.width < 1 || bounds.height < 1 { - return; + continue; } if !layer.quads.is_empty() { |