summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--core/src/renderer.rs16
-rw-r--r--core/src/shadow.rs4
2 files changed, 16 insertions, 4 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`].
diff --git a/core/src/shadow.rs b/core/src/shadow.rs
index 238ea36a..de8ce1c3 100644
--- a/core/src/shadow.rs
+++ b/core/src/shadow.rs
@@ -2,7 +2,7 @@
use crate::{Color, Vector};
/// A shadow
-#[derive(Debug, Clone, Copy, PartialEq, Default)]
+#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Shadow {
/// The color of the shadow
pub color: Color,
@@ -10,6 +10,6 @@ pub struct Shadow {
/// The offset of the shadow
pub offset: Vector,
- /// The blur_radius of the shadow
+ /// The blur radius of the shadow
pub blur_radius: f32,
}