diff options
author | 2021-10-25 16:24:26 +0700 | |
---|---|---|
committer | 2021-10-25 16:35:34 +0700 | |
commit | 687c35e052a1057042fc8ddf4968c3fa35cc6bcf (patch) | |
tree | 8024834d2fc898d53b5e18ecce414f1829ccc947 /wgpu | |
parent | 4a11cbd99445338619dfaf1f327dbc25b2983cb7 (diff) | |
download | iced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.tar.gz iced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.tar.bz2 iced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.zip |
Avoid flushing empty layers in `iced_wgpu` and `iced_glow`
Diffstat (limited to 'wgpu')
-rw-r--r-- | wgpu/src/backend.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index 2597cef3..bb84cc8f 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -119,6 +119,10 @@ impl Backend { ) { let bounds = (layer.bounds * scale_factor).snap(); + if bounds.width < 1 || bounds.height < 1 { + return; + } + if !layer.quads.is_empty() { self.quad_pipeline.draw( device, |