summaryrefslogtreecommitdiffstats
path: root/graphics/src/layer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-31 06:29:21 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-24 13:19:48 +0100
commitbaf51a8fcffc78e4ca20f7dcbba18ca3655f2840 (patch)
treefd7ba1920ac0ff57b6ddefd692d8cad5d57274cd /graphics/src/layer.rs
parentb9a9576207ddfc7afd89da30b7cfc7ca0d7e335c (diff)
downloadiced-baf51a8fcffc78e4ca20f7dcbba18ca3655f2840.tar.gz
iced-baf51a8fcffc78e4ca20f7dcbba18ca3655f2840.tar.bz2
iced-baf51a8fcffc78e4ca20f7dcbba18ca3655f2840.zip
Draft `glyphon` implementation of text pipeline for `iced_wgpu`
Diffstat (limited to '')
-rw-r--r--graphics/src/layer.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/graphics/src/layer.rs b/graphics/src/layer.rs
index 1d453caa..cc8f299c 100644
--- a/graphics/src/layer.rs
+++ b/graphics/src/layer.rs
@@ -12,7 +12,8 @@ pub use text::Text;
use crate::alignment;
use crate::{
- Background, Font, Point, Primitive, Rectangle, Size, Vector, Viewport,
+ Background, Color, Font, Point, Primitive, Rectangle, Size, Vector,
+ Viewport,
};
/// A group of primitives that should be clipped together.
@@ -60,7 +61,7 @@ impl<'a> Layer<'a> {
Point::new(11.0, 11.0 + 25.0 * i as f32),
Size::INFINITY,
),
- color: [0.9, 0.9, 0.9, 1.0],
+ color: Color::new(0.9, 0.9, 0.9, 1.0),
size: 20.0,
font: Font::Default,
horizontal_alignment: alignment::Horizontal::Left,
@@ -71,7 +72,7 @@ impl<'a> Layer<'a> {
overlay.text.push(Text {
bounds: text.bounds + Vector::new(-1.0, -1.0),
- color: [0.0, 0.0, 0.0, 1.0],
+ color: Color::BLACK,
..text
});
}
@@ -136,7 +137,7 @@ impl<'a> Layer<'a> {
content,
bounds: *bounds + translation,
size: *size,
- color: color.into_linear(),
+ color: *color,
font: *font,
horizontal_alignment: *horizontal_alignment,
vertical_alignment: *vertical_alignment,