diff options
| author | 2020-05-29 02:13:26 +0200 | |
|---|---|---|
| committer | 2020-05-29 02:13:26 +0200 | |
| commit | 8a864fcce9b974c84389a27a4cb2b3242a930750 (patch) | |
| tree | 56920437979012cceb49718f2dd4ce27d5ba5d40 /wgpu/src/backend.rs | |
| parent | e11b5c614f5bf73c137b8b4f24f56047617527eb (diff) | |
| parent | 0cde20b3550ede81bc7ddef628b91eec225aa8af (diff) | |
| download | iced-8a864fcce9b974c84389a27a4cb2b3242a930750.tar.gz iced-8a864fcce9b974c84389a27a4cb2b3242a930750.tar.bz2 iced-8a864fcce9b974c84389a27a4cb2b3242a930750.zip | |
Merge pull request #359 from hecrj/improvement/update-wgpu_glyph
Update `wgpu_glyph` and `glyph_brush`
Diffstat (limited to 'wgpu/src/backend.rs')
| -rw-r--r-- | wgpu/src/backend.rs | 19 | 
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 => { | 
