Implement Widget::draw for Text

This commit is contained in:
Héctor Ramón Jiménez 2021-10-14 16:59:19 +07:00
parent 03b3493138
commit 3a0c503db9
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
11 changed files with 128 additions and 32 deletions

View file

@ -74,7 +74,7 @@ impl<'a> Layer<'a> {
/// Distributes the given [`Primitive`] and generates a list of layers based
/// on its contents.
pub fn generate(
primitive: &'a Primitive,
primitives: &'a [Primitive],
viewport: &Viewport,
) -> Vec<Self> {
let first_layer =
@ -82,12 +82,14 @@ impl<'a> Layer<'a> {
let mut layers = vec![first_layer];
Self::process_primitive(
&mut layers,
Vector::new(0.0, 0.0),
primitive,
0,
);
for primitive in primitives {
Self::process_primitive(
&mut layers,
Vector::new(0.0, 0.0),
primitive,
0,
);
}
layers
}