Skip to content

Commit

Permalink
extract_shadows responsive coords fix (#17236)
Browse files Browse the repository at this point in the history
# Objective

`extract_shadows` uses the render world entity corresponding to the
extracted camera when it queries the main world for the camera to get
the viewport size for the responsive viewport coords resolution and
fails. This means that viewport coords get resolved based on a viewport
size of zero.

## Solution

Use the main world camera entity.
  • Loading branch information
ickshonpe authored Jan 9, 2025
1 parent 3ce8b28 commit 532bb15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ui/src/render/box_shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ pub fn extract_shadows(
continue;
};

let Ok(camera_entity) = mapping.get(camera_entity) else {
let Ok(render_entity) = mapping.get(camera_entity) else {
continue;
};

Expand Down Expand Up @@ -326,7 +326,7 @@ pub fn extract_shadows(
color: drop_shadow.color.into(),
bounds: shadow_size + 6. * blur_radius,
clip: clip.map(|clip| clip.clip),
camera_entity,
camera_entity: render_entity,
radius,
blur_radius,
size: shadow_size,
Expand Down

0 comments on commit 532bb15

Please sign in to comment.