diff options
-rw-r--r-- | glow/src/backend.rs | 5 | ||||
-rw-r--r-- | wgpu/src/backend.rs | 4 |
2 files changed, 9 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() { 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, |