summaryrefslogtreecommitdiffstats
path: root/wgpu/src/backend.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/backend.rs')
-rw-r--r--wgpu/src/backend.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs
index 88529ddd..29fc8677 100644
--- a/wgpu/src/backend.rs
+++ b/wgpu/src/backend.rs
@@ -159,7 +159,6 @@ impl Backend {
for text in layer.text.iter() {
// Target physical coordinates directly to avoid blurry text
let text = wgpu_glyph::Section {
- text: text.content,
// TODO: We `round` here to avoid rerasterizing text when
// its position changes slightly. This can make text feel a
// bit "jumpy". We may be able to do better once we improve
@@ -181,12 +180,18 @@ impl Backend {
(text.bounds.width * scale_factor).ceil(),
(text.bounds.height * scale_factor).ceil(),
),
- scale: wgpu_glyph::Scale {
- x: text.size * scale_factor,
- y: text.size * scale_factor,
- },
- color: text.color,
- font_id: self.text_pipeline.find_font(text.font),
+ text: vec![wgpu_glyph::Text {
+ text: text.content,
+ scale: wgpu_glyph::ab_glyph::PxScale {
+ x: text.size * scale_factor,
+ y: text.size * scale_factor,
+ },
+ font_id: self.text_pipeline.find_font(text.font),
+ extra: wgpu_glyph::Extra {
+ color: text.color,
+ z: 0.0,
+ },
+ }],
layout: wgpu_glyph::Layout::default()
.h_align(match text.horizontal_alignment {
HorizontalAlignment::Left => {