Skip to content

Commit

Permalink
Fix physical_bounds shadowing in wgpu render
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 14, 2025
1 parent 7526d73 commit 7c54bde
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7c54bde

Please sign in to comment.