summaryrefslogtreecommitdiffstats
path: root/glow
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-25 16:24:26 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-25 16:35:34 +0700
commit687c35e052a1057042fc8ddf4968c3fa35cc6bcf (patch)
tree8024834d2fc898d53b5e18ecce414f1829ccc947 /glow
parent4a11cbd99445338619dfaf1f327dbc25b2983cb7 (diff)
downloadiced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.tar.gz
iced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.tar.bz2
iced-687c35e052a1057042fc8ddf4968c3fa35cc6bcf.zip
Avoid flushing empty layers in `iced_wgpu` and `iced_glow`
Diffstat (limited to 'glow')
-rw-r--r--glow/src/backend.rs5
1 files changed, 5 insertions, 0 deletions
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() {