Skip to content

Commit

Permalink
Fix border rendering of transparent Container
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jul 18, 2020
1 parent 4030326 commit 9b77800
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions graphics/src/widget/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}

0 comments on commit 9b77800

Please sign in to comment.