From cc906c83cdf896d94b7ccf91258466714be631f6 Mon Sep 17 00:00:00 2001 From: Nick Senger Date: Wed, 8 Nov 2023 19:12:53 -0800 Subject: feat: quad shadows --- graphics/src/primitive.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'graphics/src/primitive.rs') diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index 20affaaf..795d9609 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -71,6 +71,12 @@ pub enum Primitive { border_width: f32, /// The border color of the quad border_color: Color, + /// The shadow color of the quad + shadow_color: Color, + /// The shadow offset of the quad + shadow_offset: Vector, + /// The shadow blur radius of the quad + shadow_blur_radius: f32, }, /// An image primitive Image { -- cgit From b7b457a575cdd103915994f640c50262ce30a7c5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 12:11:18 +0100 Subject: Make `shadow` optional in `renderer::Quad` --- graphics/src/primitive.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'graphics/src/primitive.rs') diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index 795d9609..a428c31a 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -3,7 +3,9 @@ use crate::core::alignment; use crate::core::image; use crate::core::svg; use crate::core::text; -use crate::core::{Background, Color, Font, Pixels, Point, Rectangle, Vector}; +use crate::core::{ + Background, Color, Font, Pixels, Point, Rectangle, Shadow, Vector, +}; use crate::text::editor; use crate::text::paragraph; @@ -71,12 +73,8 @@ pub enum Primitive { border_width: f32, /// The border color of the quad border_color: Color, - /// The shadow color of the quad - shadow_color: Color, - /// The shadow offset of the quad - shadow_offset: Vector, - /// The shadow blur radius of the quad - shadow_blur_radius: f32, + /// The [`Shadow`] of the quad + shadow: Option, }, /// An image primitive Image { -- cgit From 25f182f933ea6b7c112c8f9a450a98dc9b9eebdd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 13:29:25 +0100 Subject: Introduce `Border` struct analogous to `Shadow` --- graphics/src/primitive.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'graphics/src/primitive.rs') diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs index a428c31a..aed59e1a 100644 --- a/graphics/src/primitive.rs +++ b/graphics/src/primitive.rs @@ -4,7 +4,7 @@ use crate::core::image; use crate::core::svg; use crate::core::text; use crate::core::{ - Background, Color, Font, Pixels, Point, Rectangle, Shadow, Vector, + Background, Border, Color, Font, Pixels, Point, Rectangle, Shadow, Vector, }; use crate::text::editor; use crate::text::paragraph; @@ -67,14 +67,10 @@ pub enum Primitive { bounds: Rectangle, /// The background of the quad background: Background, - /// The border radii of the quad - border_radius: [f32; 4], - /// The border width of the quad - border_width: f32, - /// The border color of the quad - border_color: Color, + /// The [`Border`] of the quad + border: Border, /// The [`Shadow`] of the quad - shadow: Option, + shadow: Shadow, }, /// An image primitive Image { -- cgit