summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs3
-rw-r--r--wgpu/src/layer/text.rs5
2 files changed, 7 insertions, 1 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index b9fd044e..dcae0648 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -62,6 +62,7 @@ impl<'a> Layer<'a> {
),
color: Color::new(0.9, 0.9, 0.9, 1.0),
size: 20.0,
+ line_height: core::text::LineHeight::Relative(1.2),
font: Font::MONOSPACE,
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,
@@ -114,6 +115,7 @@ impl<'a> Layer<'a> {
content,
bounds,
size,
+ line_height,
color,
font,
horizontal_alignment,
@@ -126,6 +128,7 @@ impl<'a> Layer<'a> {
content,
bounds: *bounds + translation,
size: *size,
+ line_height: *line_height,
color: *color,
font: *font,
horizontal_alignment: *horizontal_alignment,
diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs
index 665f7188..ba1bdca8 100644
--- a/wgpu/src/layer/text.rs
+++ b/wgpu/src/layer/text.rs
@@ -14,9 +14,12 @@ pub struct Text<'a> {
/// The color of the [`Text`], in __linear RGB_.
pub color: Color,
- /// The size of the [`Text`].
+ /// The size of the [`Text`] in logical pixels.
pub size: f32,
+ /// The line height of the [`Text`].
+ pub line_height: text::LineHeight,
+
/// The font of the [`Text`].
pub font: Font,