Add Shadow to container::Appearance

This commit is contained in:
Héctor Ramón Jiménez 2024-01-20 13:34:07 +01:00
parent e736038d5f
commit bf375587aa
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 11 additions and 6 deletions

View file

@ -392,15 +392,14 @@ where
};
if styling.background.is_some()
|| styling.shadow.color.a > 0.0
|| styling.border.width > 0.0
|| styling.shadow.color.a > 0.0
{
renderer.fill_quad(
renderer::Quad {
bounds,
border: styling.border,
shadow: styling.shadow,
..renderer::Quad::default()
},
styling
.background

View file

@ -337,12 +337,15 @@ pub fn draw_background<Renderer>(
) where
Renderer: crate::core::Renderer,
{
if appearance.background.is_some() || appearance.border.width > 0.0 {
if appearance.background.is_some()
|| appearance.border.width > 0.0
|| appearance.shadow.color.a > 0.0
{
renderer.fill_quad(
renderer::Quad {
bounds,
border: appearance.border,
..renderer::Quad::default()
shadow: appearance.shadow,
},
appearance
.background