Skip to content

Commit

Permalink
Default UI shadow samples fix (#15953)
Browse files Browse the repository at this point in the history
# 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`.
  • Loading branch information
ickshonpe authored Oct 16, 2024
1 parent eb67c81 commit fc659a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/render/box_shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
);

Expand Down

0 comments on commit fc659a6

Please sign in to comment.