Make shadow optional in renderer::Quad

This commit is contained in:
Héctor Ramón Jiménez 2024-01-20 12:11:18 +01:00
parent 83902921a3
commit b7b457a575
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 57 additions and 46 deletions

View file

@ -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`].