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` --- glow/src/backend.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'glow') diff --git a/glow/src/backend.rs b/glow/src/backend.rs index 9212761e..5ab7f922 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -79,6 +79,11 @@ impl Backend { target_height: u32, ) { let mut bounds = (layer.bounds * scale_factor).snap(); + + if bounds.width < 1 || bounds.height < 1 { + return; + } + bounds.height = bounds.height.min(target_height); if !layer.quads.is_empty() { -- cgit