From fc659a61435ec8be58006f67b5edba1b5289f8a5 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Wed, 16 Oct 2024 18:01:10 +0100 Subject: [PATCH] Default UI shadow samples fix (#15953) # Objective In `queue_shadows`, the `UiBoxShadows` option is unwrapped incorrectly which results in the number of shadow samples being set to `u32::default()` instead of `UiBoxShadows::default()` if the camera entity doesn't have the component. ## Solution Just use `unwrap_or_default` directly without `map`. --- crates/bevy_ui/src/render/box_shadow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/render/box_shadow.rs b/crates/bevy_ui/src/render/box_shadow.rs index 209344f068..0f7f3fb958 100644 --- a/crates/bevy_ui/src/render/box_shadow.rs +++ b/crates/bevy_ui/src/render/box_shadow.rs @@ -356,7 +356,7 @@ pub fn queue_shadows( &ui_slicer_pipeline, UiTextureSlicePipelineKey { hdr: view.hdr, - samples: shadow_samples.map(|samples| samples.0).unwrap_or_default(), + samples: shadow_samples.copied().unwrap_or_default().0, }, );