From 532bb15489df6a302215e13be9f916ed2280fe86 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Thu, 9 Jan 2025 06:29:09 +0000 Subject: [PATCH] `extract_shadows` responsive coords fix (#17236) # 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. --- crates/bevy_ui/src/render/box_shadow.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/render/box_shadow.rs b/crates/bevy_ui/src/render/box_shadow.rs index f0b2e18711417..6ad450bcfbbbd 100644 --- a/crates/bevy_ui/src/render/box_shadow.rs +++ b/crates/bevy_ui/src/render/box_shadow.rs @@ -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; }; @@ -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,