diff options
author | 2020-07-18 03:05:14 +0200 | |
---|---|---|
committer | 2020-07-18 03:05:14 +0200 | |
commit | 9b778006ce7a56b129cc779b5bad31931d5faf12 (patch) | |
tree | 995b5541233299f47582a0b0d4deefdd4d341e21 /graphics/src | |
parent | 4030326a352c365a282980aa2a37d549f4b659ae (diff) | |
download | iced-9b778006ce7a56b129cc779b5bad31931d5faf12.tar.gz iced-9b778006ce7a56b129cc779b5bad31931d5faf12.tar.bz2 iced-9b778006ce7a56b129cc779b5bad31931d5faf12.zip |
Fix border rendering of transparent `Container`
Fixes #452
Diffstat (limited to 'graphics/src')
-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, - }) } |