From 687c35e052a1057042fc8ddf4968c3fa35cc6bcf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 25 Oct 2021 16:24:26 +0700 Subject: Avoid flushing empty layers in `iced_wgpu` and `iced_glow` --- wgpu/src/backend.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wgpu') 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, -- cgit