From 7c54bdef1062e4008582d8b1e215ffcc1c1ee016 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 14 Feb 2025 23:14:13 +0100 Subject: Fix `physical_bounds` shadowing in `wgpu` render --- wgpu/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 9c9fcb31..b1998da7 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -280,13 +280,16 @@ impl Renderer { let scale = Transformation::scale(scale_factor); for layer in self.layers.iter() { - let Some(scissor_rect) = physical_bounds - .intersection(&(layer.bounds * scale_factor)) - .and_then(Rectangle::snap) + let Some(physical_bounds) = + physical_bounds.intersection(&(layer.bounds * scale_factor)) else { continue; }; + let Some(scissor_rect) = physical_bounds.snap() else { + continue; + }; + if !layer.quads.is_empty() { engine.quad_pipeline.render( quad_layer, -- cgit