summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-31 21:35:42 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-31 21:38:52 +0100
commit9ab7c47dc7d834ee73bc068f9f34eea4d6946436 (patch)
treeea52e51ffef12208a47fe29299c70095ad403957 /wgpu/src/renderer.rs
parent649d72e7de88e593255075957e65414ed1b4d0d6 (diff)
downloadiced-9ab7c47dc7d834ee73bc068f9f34eea4d6946436.tar.gz
iced-9ab7c47dc7d834ee73bc068f9f34eea4d6946436.tar.bz2
iced-9ab7c47dc7d834ee73bc068f9f34eea4d6946436.zip
Add `border_width` and `border_color` to `Quad`
Diffstat (limited to '')
-rw-r--r--wgpu/src/renderer.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index 1b143d90..efda046b 100644
--- a/wgpu/src/renderer.rs
+++ b/wgpu/src/renderer.rs
@@ -223,6 +223,8 @@ impl Renderer {
bounds,
background,
border_radius,
+ border_width,
+ border_color,
} => {
// TODO: Move some of this computations to the GPU (?)
layer.quads.push(Quad {
@@ -235,6 +237,8 @@ impl Renderer {
Background::Color(color) => color.into_linear(),
},
border_radius: *border_radius as f32,
+ border_width: *border_width as f32,
+ border_color: border_color.into_linear(),
});
}
Primitive::Image { handle, bounds } => {
@@ -470,11 +474,12 @@ fn explain_layout(
color: Color,
primitives: &mut Vec<Primitive>,
) {
- // TODO: Draw borders instead
primitives.push(Primitive::Quad {
bounds: layout.bounds(),
- background: Background::Color([0.0, 0.0, 0.0, 0.05].into()),
+ background: Background::Color(Color::TRANSPARENT),
border_radius: 0,
+ border_width: 1,
+ border_color: [0.6, 0.6, 0.6, 0.5].into(),
});
for child in layout.children() {