summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-20 13:29:25 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-20 13:29:25 +0100
commit25f182f933ea6b7c112c8f9a450a98dc9b9eebdd (patch)
treefdc498d705f033d3c432e6a06b8cd223dfd82633 /wgpu
parent4d502012b3e3ed9d9ef80f21078d53d182cdaa1b (diff)
downloadiced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.tar.gz
iced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.tar.bz2
iced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.zip
Introduce `Border` struct analogous to `Shadow`
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index cb91878d..e213c95f 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -12,9 +12,7 @@ pub use text::Text;
use crate::core;
use crate::core::alignment;
-use crate::core::{
- Color, Font, Pixels, Point, Rectangle, Shadow, Size, Vector,
-};
+use crate::core::{Color, Font, Pixels, Point, Rectangle, Size, Vector};
use crate::graphics;
use crate::graphics::color;
use crate::graphics::Viewport;
@@ -197,28 +195,20 @@ impl<'a> Layer<'a> {
Primitive::Quad {
bounds,
background,
- border_radius,
- border_width,
- border_color,
+ border,
shadow,
} => {
let layer = &mut layers[current_layer];
- let shadow = shadow.unwrap_or_else(|| Shadow {
- color: Color::TRANSPARENT,
- offset: Vector::ZERO,
- blur_radius: 0.0,
- });
-
let quad = Quad {
position: [
bounds.x + translation.x,
bounds.y + translation.y,
],
size: [bounds.width, bounds.height],
- border_color: color::pack(*border_color),
- border_radius: *border_radius,
- border_width: *border_width,
+ border_color: color::pack(border.color),
+ border_radius: border.radius.into(),
+ border_width: border.width,
shadow_color: shadow.color.into_linear(),
shadow_offset: shadow.offset.into(),
shadow_blur_radius: shadow.blur_radius,