diff options
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/src/widget/container.rs | 24 | 
1 files changed, 12 insertions, 12 deletions
diff --git a/graphics/src/widget/container.rs b/graphics/src/widget/container.rs index 576062d4..5b3a01d2 100644 --- a/graphics/src/widget/container.rs +++ b/graphics/src/widget/container.rs @@ -56,17 +56,17 @@ pub(crate) fn background(      bounds: Rectangle,      style: &container::Style,  ) -> Option<Primitive> { -    if style.background.is_none() && style.border_width > 0 { -        return None; +    if style.background.is_some() || style.border_width > 0 { +        Some(Primitive::Quad { +            bounds, +            background: style +                .background +                .unwrap_or(Background::Color(Color::TRANSPARENT)), +            border_radius: style.border_radius, +            border_width: style.border_width, +            border_color: style.border_color, +        }) +    } else { +        None      } - -    Some(Primitive::Quad { -        bounds, -        background: style -            .background -            .unwrap_or(Background::Color(Color::TRANSPARENT)), -        border_radius: style.border_radius, -        border_width: style.border_width, -        border_color: style.border_color, -    })  }  | 
