summaryrefslogtreecommitdiffstats
path: root/graphics/src/widget/container.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-18 03:05:14 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-18 03:05:14 +0200
commit9b778006ce7a56b129cc779b5bad31931d5faf12 (patch)
tree995b5541233299f47582a0b0d4deefdd4d341e21 /graphics/src/widget/container.rs
parent4030326a352c365a282980aa2a37d549f4b659ae (diff)
downloadiced-9b778006ce7a56b129cc779b5bad31931d5faf12.tar.gz
iced-9b778006ce7a56b129cc779b5bad31931d5faf12.tar.bz2
iced-9b778006ce7a56b129cc779b5bad31931d5faf12.zip
Fix border rendering of transparent `Container`
Fixes #452
Diffstat (limited to '')
-rw-r--r--graphics/src/widget/container.rs24
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,
- })
}