diff options
author | 2024-01-20 12:11:18 +0100 | |
---|---|---|
committer | 2024-01-20 12:11:18 +0100 | |
commit | b7b457a575cdd103915994f640c50262ce30a7c5 (patch) | |
tree | c8b910de89e2e723051dc8058f796ec022026a49 /core/src/renderer.rs | |
parent | 83902921a3065e8dadfaca23c2e03dd770d93780 (diff) | |
download | iced-b7b457a575cdd103915994f640c50262ce30a7c5.tar.gz iced-b7b457a575cdd103915994f640c50262ce30a7c5.tar.bz2 iced-b7b457a575cdd103915994f640c50262ce30a7c5.zip |
Make `shadow` optional in `renderer::Quad`
Diffstat (limited to 'core/src/renderer.rs')
-rw-r--r-- | core/src/renderer.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/src/renderer.rs b/core/src/renderer.rs index 481048b0..1ca62559 100644 --- a/core/src/renderer.rs +++ b/core/src/renderer.rs @@ -5,7 +5,7 @@ mod null; #[cfg(debug_assertions)] pub use null::Null; -use crate::{Background, BorderRadius, Color, Rectangle, Shadow, Vector}; +use crate::{Background, BorderRadius, Color, Rectangle, Shadow, Size, Vector}; /// A component that can be used by widgets to draw themselves on a screen. pub trait Renderer: Sized { @@ -47,7 +47,19 @@ pub struct Quad { pub border_color: Color, /// The shadow of the [`Quad`]. - pub shadow: Shadow, + pub shadow: Option<Shadow>, +} + +impl Default for Quad { + fn default() -> Self { + Self { + bounds: Rectangle::with_size(Size::ZERO), + border_radius: 0.0.into(), + border_width: 0.0, + border_color: Color::TRANSPARENT, + shadow: None, + } + } } /// The styling attributes of a [`Renderer`]. |